protocol: ship the first wire contract as 1.0, not 1.14 #325
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!325
Loading…
Reference in a new issue
No description provided.
Delete branch "minor-reset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #313.
The minor ledger reached 14 rows before any peer existed. Every one of those rows describes compatibility with a daemon that was never released, so the gates, fallbacks and downgrade paths they justify are dead weight the first release would have to carry forever — and the first ledger row that ever matters would be numbered 15.
This folds the whole pre-release schema into the minor-0 base.
What changes
PROTOCOL_MINOR14 -> 0; the 14MINOR_*constants are gone andMINOR_LEDGERhas one row:(0, "the base schema of protocol major 1"). The preface golden vectors move to1.0.felis.proto: thePROTOCOL_MINORheader comment is 0 and all 11 nonzero(felis.v1.arm).sincevalues becomesince: 0, keeping the explicit-zero style every base arm already used. Generated Rust regenerated withbuf lint && buf generate.GatedFieldtables inminor.rsare empty, and everysince_minor()on the closed enums returns 0. The tables and therequiresimpls that fold them stay, so the first post-release field is one row and nothing else.Downgradetrait and every impl are deleted: with no older peer to map to, every closed-enum value is in the base schema, and a future narrowing needs its own mapping regardless.check_scope_minor,check_key_input_minor,check_mode_minor, the atomic-create and attach-by-prefix fallbacks,effective_minorplumbing through the session task, subscriber and bridge link).check_arm_minor,FrameWriter::authorize,TransportError::MinorTooOldandConnectError::MinorTooOldare retained.PROTOCOL_MINOR + 1, at three layers:minor.rs(Requires/arm_requires),connector.rs(check_arm_minor) andframing.rs(FrameWriter::authorizeviaCheckedFrame::raw, behindfeature = "test-util").docs/reference/ipc.mdledger table collapses to row 0 and ~12 prose sites lose their minor numbers;docs/reference/cli.mdsayswire: 1.0; the architecture, session-lifecycle and testing pages follow.[0.1.0]and earlier sections are untouched.Deviation worth a look
The brief says to drop
ConnectionMode::since_minor, and I followed it literally, which also tookcheck_mode_minorand the mode half of the gating with it.since_minor()is kept onAttachFailure,RefusalReasonandResourceKindso the closed-enum half ofthe_ledger_covers_every_executable_additionstays alive. If modes should keep a declared minor for symmetry, say so and I will put it back at 0.Gates
cargo clippy --workspace --all-targets --all-features— clean, no warningscargo nextest run --workspace --all-features --all-targets --retries 2— 3453 passed, 0 failed, 16 skippedjust proto-compat— wire-compatible with the basejust docs-links— 392 unique links, 0 errorspython3 tools/prose_check.py --range origin/main...HEAD— 0 hitsSKIP:buf breakingpassed (field options are invisible to it)The #164 follow-up is rewritten as a comment on that issue, since its body described the pre-reset ledger.
Sol round 1 blocker addressed in
405eca25(additive commit, no rebase, no force-push).Blocker —
ConnectionModeis back inside minor authorization. The deviation I flagged in the description is reverted; treat that section of the body as stale.ConnectionMode::since_minor()restored incrates/felis-protocol/src/minor.rs, every shipped mode at 0.ConnMsg::Hellofolds it again:arm.max(Requires::new(mode.since_minor(), "ConnectionMode")), so a mode is no longer carried by its arm's base requirement alone.gated_enum_values, sothe_ledger_covers_every_executable_additionmechanically checks that every mode declares an introducing minor.check_mode_minorrestored incrates/felis-client-core/src/connector.rsand called before theHellogoes out, yielding the non-transientConnectError::MinorTooOldrather than an unexplained EOF.a_hello_costs_the_minor_that_defined_its_mode(protocol) anda_mode_above_the_effective_minor_is_refused(connector, assertsMinorTooOldand!is_transient()).docs/reference/ipc.mdgets its send-side half back: theHellobullet says the sender names only a mode the effective minor defines, and "Connection modes" states both ends of the rule again.Non-blocking — development-minor history removed from comments.
crates/felis-client-core/src/roster.rs: "a pre-minor-3 roster" -> "a roster that carries no sequences".crates/felis-protocol/src/messages.rs: "a// Minor 13.beside asince:" -> "a comment beside asince:".minor [1-9]/minor-[1-9]/1.[1-9]found one more:crates/felis-protocol/proto/BREAKING.mdclaimed "1.9 is the first public baseline", now "the first public baseline is still unpublished". Every other hit in the tree is an unrelated decimal (byte counts, ratios, MSRV).Gates on
405eca25cargo clippy --workspace --all-targets --all-features— cleancargo nextest run --workspace --all-features --all-targets --retries 2— 3455 passed, 0 failed, 16 skippedjust proto-compat— wire-compatible with the basejust docs-links— 392 unique, 0 errorspython3 tools/prose_check.py --range origin/main...HEAD— 0 hits--no-verify, noSKIPprotocol_mismatchkind without a constructorWindows clippy fixed in
ec9d85a8(additive, no rebase, no force-push).The failure is not target-specific.
ErrorKind::ProtocolMismatchhas no constructor on any target: its only one was the keyboard-input minor gate incli_sessions.rs, which went when the whole schema became minor 0.ConnectError::MinorTooOldalready maps toErrorKind::Unsupported(cli_output.rs:267), target-independently and unchanged from main, so there was no unix-only mapping to generalize.What hid it on the Linux job is the feature set, not the target:
ErrorKind::ALLis#[cfg(any(test, feature = "schema"))]and names every variant, so--all-featuresconstructs the variant while the Windows cross job —cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnu, no--all-features— does not.cargo clippy -p felis-cli --all-targetson Linux reproduces it exactly.Fix: the variant stays and is annotated deliberately.
protocol_mismatchis published incrates/felis-cli/schemas/felis-cli-v1.schema.json,tests/golden/error_kinds.txtanddocs/reference/cli.md, and the vocabulary is frozen within av, so deleting it would break a consumer that already branches on it. The doc comment now says nothing can raise it while major 1 is the only generation and the schema is all minor 0, and#[allow(dead_code)]sits on that variant alone. The golden still lists it (felis-clisuite: 331 passed).Verified
nix develop .#windows -c cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnu -- -D warnings— passes. The one remaining warning is the pre-existingunused dependency \rustix`manifest warning infelis-pty`, unrelated to this PR and not fatal.cargo clippy --workspace --all-targets(no--all-features) — cleancargo clippy --workspace --all-targets --all-features— cleancargo nextest run -p felis-cli --all-features --all-targets --retries 2— 331 passedpython3 tools/prose_check.py --range origin/main...HEAD— 0 hits--no-verify, noSKIP