Repository navigation
feat(loaderkit): ask the contract for the resource-kind set (TODO 3.1, leg 2 of 3) - #564
Conversation
…, leg 2 of 3) The loader derived its own copy of the #ResourceKind membership at package init: resourceKindSet = sliceSet(spec.ResourceKinds) so the parse and the contract held two independent derivations of one list that could only agree by luck. The parse now asks spec.ResourceKindSet() at every consult (memberDisc and the deploy-body member scan), and the copy is gone. sliceSet stays standing for its six other callers; only the resource-kind site moves. RED-first, on the right claim. The test makes spec.ResourceKinds MOVE and asks the parse, so it fails while the loader answers from its own copy and passes only when the verdict comes from the contract: memberDisc does not see a word the composed schema now declares: the loader answers from a snapshot taken at package init, so its verdict can disagree with spec.ResourceKindSet() The observable is divergence, not compilation. The earlier `undefined: ResourceKindSet` failure available on an un-bumped tree was refused for exactly that reason: it proves a symbol is missing, not that the two derivations can disagree. Base moved during the wait, deliberately and for a measured reason: this branch was rebased from sdk#561's head (8de8a57, carrying the spec v0.2026322.1616 bump) onto aec1d52, because #561 was CLOSED as a policy action while its content landed through #563 and the deploykit fix. The redundant commits are dropped rather than inherited, which is why the diff is one behaviour change and not a pin bump. Premise re-measured at the new tip (spec v0.2026322.1814 carries spec.ResourceKindSet; loaderkit/parse.go:35 still held its own copy), not assumed. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: behaviour change inside a library module ( Security screen: PASS — no secrets, no egress, no guardrail weakening; the two comment edits and the Blocks
Non-blocking note (rulebook gap, not a block): the new divergence test Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: behaviour change inside a library module ( Blocks
Comment disposition
Non-blocking note (rulebook gap): the new test exercises only Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — T1–T4 clear: no scope mismatch, no secrets/egress, no guardrail weakening, no new deps; the four-file change is exactly the stated Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
TODO.md 3.1, leg 2 of 3 (leg 1:
spec#381; tracking:spec#380). The loader stops deriving its own copy of the#ResourceKindmembership and asks the contract at every consult.Before:
Two independent derivations of one contract-owned list, in two modules, able to agree only by luck — and a copy taken at package init answers from the vocabulary it saw then. After:
memberDiscand the deploy-body member scan callspec.ResourceKindSet(), and the copy is gone.sliceSetstays standing. It has six other callers in this file (StepKeywords,DocDirectives,AuthoringVerbs,KindWords, the instrument modifiers) — only the resource-kind site moves. That is measured, not assumed: a body that promised to delete the helper would have been wrong, and the sweep caught it before a verdict did.Scope: one behaviour change, four files, +49/−6. No pin bump — see the base note below.
How tested
The RED that matters, taken on this branch's base
aec1d52by restoringloaderkit/parse.goto its pre-change form so the loader holds its own copy again:GREEN on the restored tree:
The test makes
spec.ResourceKindsmove and then asks the parse: a loader holding a snapshot fails, a loader asking the contract passes. The observable is divergence, not compilation — an earlierundefined: spec.ResourceKindSetfailure was available on an un-bumped tree and was deliberately refused, because it proves only that a symbol is missing.The second consult site (
loaderkit/parse.go:238, the deploy-body member scan) carries no separate test, and does not need one to be forced:resourceKindSetno longer exists as a symbol, so a revert to a snapshot at that site is a compile error rather than a silent regression. The compile-time deletion is what makes that site safe; the test guards the site where a snapshot could be re-introduced without a compile error — the classification helper.The module gate, on the committed tree:
The linter runs under
go1.26.8because the localgois 1.27.3, whose export-data version the pinnedgolangci-lintv2.13.2 cannot read — the environment mismatchsdk/AGENTS.mdrecords.No bed, and the negative is proven rather than asserted — a Contract/library module has no bed class:
The base moved, deliberately
This branch was rebased from
8de8a57b(the head ofsdk#561, which carried thespec v0.2026322.1616bump) ontoaec1d52, because#561was CLOSED as a policy action while its content landed through#563and the deploykit fix. Its two commits are now redundant, so they are dropped rather than inherited — which is why this diff is one behaviour change and not a pin bump. It waited on a tag that will never exist; the premise was re-measured at the new tip rather than assumed:spec.ResourceKindSetexists at the pinsdkalready requires, and the copy was still standing at the tip — both measured above. Note that a squash merge has no ancestry —merge-base --is-ancestorwould answer false even where the tag carries the work — so the pin was verified by the tree and the subject, not the graph.Rulebook compliance
/charly-internals:goand/charly-internals:git-workflowloaded before any git action;sdk/AGENTS.mdread (Part II fix(kit): aur builder fails loudly on zero produced packages (R8) #4) including its DESIGN.md section.sdk#560carries the RCA forspec#379's un-sweptacme_emaildeletion (six reader sites acrosskit/anddeploykit/), which is why this leg waited rather than bumping through it. Every reader in this change's own scope was swept by name and by pathspec below, and thesliceSetsweep is what stopped the body from promising a deletion it could not deliver.sliceSetcallers are a different question (sdk#560-adjacent, not this change), and the helper is left standing because deleting it would break six legitimate uses.resourceKindSetis deleted, and the two comments that located it were corrected to name the contract accessor — the reason moved, not vanished, so the next reader inherits the argument rather than a gap.git statusread before each move (clean before the rebase, empty after the RED restore);feat/resource-kind-setin a session worktree, trackedsdk/untouched; no force-push (the branch was never pushed), no bypass. The rebase was a deliberate re-branch ontoaec1d52on an unpushed branch, which is legal authoring.disposable:grep shows no bed can exist here.Consumers swept (the
acme_emaildeletion this leg rides past)spec#379deleted the field; the reader sweep below is the evidence thatsdkis now clean of it and thatcharlynever read it. The pin isv0.2026322.1814:One site survives and it is prose — a comment recording that
AcmeEmailwas on the label list untilspec#379removed it. No reader, no fixture, no map entry: the six live sites this leg would otherwise have inherited (kit/checkvars.go,kit/checkvars_test.go,deploykit/deploy_file.go,deploykit/capabilities.go'sCapabilityLabelMap) were adapted in#563and its deploykit sibling, and#560carries the RCA.The consumer-side fix is a fallback being executed.
specdeleted the field, tagged it, and the consumer one workspace away was never swept. The ordering cost was one merge rather than one round only because the sweep ran late rather than never — and a producer's deletion is proven before its TAG, not before its merge, because after the tag every consumer inherits the break.Filed issues
spec#379's un-sweptacme_emaildeletion: six reader sites acrosskit/anddeploykit/, which is why this leg waited on a green bumped tree instead of bumping through the break itself. The readers were adapted in#563and its deploykit sibling; this PR carries neither the bump nor the adaptation.Change classification
Kind: behaviour inside one module. The parse's resource-kind verdict now comes from the contract at consult time instead of from a package-init snapshot; any vocabulary the contract declares is visible to the parse immediately, which is the behaviour the contract always claimed. No wire key, no authored shape and no exported API changes here. Nothing breaks for consumers:
spec.ResourceKindSet()already exists at the pin this repo requires, and the deleted symbol was unexported. Rollback: revert this commit — the loader returns to its private copy, which still compiles against the current pin.Files changed
loaderkit/parse.goresourceKindSetcopy deleted;memberDiscand the deploy-body member scan askspec.ResourceKindSet()loaderkit/deploy_decode.goparse.gonow names the contract accessor — the reason moved, not deletedloaderkit/node_tree.goloaderkit/resource_kind_live_test.gospec.ResourceKinds, ask the parse, with a control that an undeclared word stays outAgent: audit-parse
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)