docs(protocol): correct the provenance honesty contract to the shipped behaviour - #68
Conversation
…d behaviour The contract told adopters the daemon renders absence as \declared_absent\.\nThat state does not exist: ModuleDeclaredProvenance has only Reported and\nUnverifiable, an omitted field is dropped by skip_serializing_if, and ck\nrenders it as \unavailable\. The prose also read as though a full field set\nwas expected and as though commit identity required a release pipeline, both\nof which sent a real adopter toward inventing values it could not honestly\ndeclare.\n\nCONSUMER-IMPACT: none — documentation only.
87570ac to
2472ede
Compare
|
Amended to A fleet seat pointed out that the render already distinguishes the two levels, and I confirmed it against two live modules that happen to be in opposite states right now:
My first version only named
Still doc-only, no new state introduced, and the capability was already shipped — this is the contract catching up to the render rather than asking anything of it. Worth recording that I had this backwards a moment ago: I told that seat the two-level distinction would be a "deeper fix" for later. It was already there. The check that settled it was having one module in each state simultaneously and running both renders side by side — a comparison that is only available while the fleet is mid-adoption, and will not be once every module declares.
|
|
Amended again to What happenedTwo modules declared the same field with values four minor versions apart, in different numbering spaces: Both readings are natural from the name alone. The adopter's The field was already defined — in code, not in prose
pub fn build_provenance(
build_git_sha: Option<&str>,
build_lock_digest: Option<&str>,
store_schema_version: Option<&str>, // three params
) -> ManifestProvenance {
ManifestProvenance {
...
wire_crate_version: Some(SUBC_PROTOCOL_CRATE_VERSION.to_string()), // not a param
...
}
}
So the referent was pinned in code and silent in the doc, and a module that hand-rolls the field instead of calling AddedOn On Note on the nameIf this field had been Still doc-only. |
|
Amended to I said the diverging module "bypassed the constructor." It cannot reach the constructor. Verified against its manifest: It is a transport-direct consumer — The fix that does reach them is the constant, not the constructor: // subc-protocol/src/lib.rs:125
pub const SUBC_PROTOCOL_CRATE_VERSION: &str = env!("CARGO_PKG_VERSION");
Why this strengthens the rename questionThe per-field doc works here only because the referent happens to live in the crate every consumer shares. Had it been pinned solely in A field named I am not proposing the rename in this PR — it is doc-only and should stay that way. Flagging that the window is open now and closes as adoption spreads. VerificationOne pre-existing rustdoc warning survives on |
|
Thanks for My first instinct was toolchain skew: CI runs a newer clippy than my distro Fires loudly, locally, on the exact merged commit. The lint was fully catchable here. What actually happened: I amended the commit twice and re-ran only a subset the second time. Amendment 1 (per-field docs) got test + clippy + fmt, all clean. Amendment 2 — the one that rewrote the Two things I am taking from it:
Also flagging the near-miss on the diagnosis itself: had I accepted "CI has a newer clippy," I would have filed a toolchain story over a process defect and kept the hole. Same class as everything else in this PR's history — a plausible mechanism that is not this mechanism. Separately, from the run that carried these merges: |
Closes #67. Documentation only — one doc comment on
ManifestProvenance, no code, no wire, no behaviour.The defect
The honesty contract told adopters:
declared_absentdoes not exist. It appeared exactly once in the repository — in that sentence. What actually happens:ModuleDeclaredProvenance(subc-control/src/lib.rs:413-419) has two variants,Reported { build }andUnverifiable, discriminated by whether the HELLO manifest carried a provenance block at all.skip_serializing_if = "Option::is_none"(manifest.rs:125-131).ck provenancerenders it throughprovenance_value's fallback arm as the literalunavailable(ck.rs:1393-1405).This is mine, shipped in #59 — and it is the same announced-name-vs-shipped-name class that got
CK_BUILD_REVreverted on #58, sitting in the one file whose purpose is telling adopters what is honest.Three edits
declared_absent→ the real behaviour. An omitted field renders asunavailable, and the module still reports asReported, since declaration status is decided at the block level."No field is required" stated explicitly. "Every field is a VERIFIED-AT-BUILD claim" read as though a full set was expected, so an adopter with a legitimately inapplicable field had to go read the wire type to discover otherwise.
Noneforbuild_git_shano longer implies "needs a release pipeline." TheCK_BUILD_REV-via-packaging-path example read as the only sanctioned source. The actual bar is knowing whether the tree was clean — a.gitread, not infrastructure — and the existing-dirtyand omit-when-dirty clauses already sanction both upgrade paths.Everything else is preserved: the
option_env!guidance,-dirtysemantics, cerebellum's stricter-is-better note, the two CEREB silent-when-wrong checks, and the closing fill-fields-FROM-THE-BUILD clause.How it surfaced, since the provenance is the interesting part
The first module seat to adopt the declaration read the contract literally and asked whether
Noneinstore_schema_versionwould score as a gap or as honest absence — their module is cache-only and has no store schema, so declaring a version would have meant minting a schema identity to satisfy a field. Answering required reading the type, which is where the missing state showed up.Both gaps this PR fills are things that adopter hit in the first hour of using the contract: one concluded they needed a packaging pipeline to declare commit identity (they do not), and one could not tell whether omitting an inapplicable field would score against them (it does not).
Verification
Gates are not ceremony for a doc-only change here — rustdoc link syntax and doctests both build.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.