TASK-0013: add dev plugin key tooling - #25
Conversation
The dev-key loop needs a tool that exercises the same manifest payload and verification path as the server without touching release signing. This adds a dev-only helper that emits local trust files, writes dev manifests outside the tracked manifest, and proves production trust still rejects a dev publisher unless that publisher is explicitly trusted. Constraint: TASK-0011 Decision 5 allows tools/** and test-only proof, but forbids cmd/pluginsign behavior and TrustPolicy evaluation changes. Rejected: Wrap cmd/pluginsign in the dev target | rules/03 keeps pluginsign invocations out of this seat and the dev loop should never depend on the operator release signer. Rejected: Write the dev signature back into manifest.json | too easy to commit a dev publisher into the release manifest. Confidence: high Scope-risk: narrow Directive: devplugin is for dev.<handle> publishers only; do not loosen it to sign as latticenet. Tested: go test ./tools/devplugin -count=1; go test ./internal/plugin -run TestVerifyManifestRejectsDevPublisherNotInTrustPolicy -count=1; go test -race -cover ./tools/devplugin ./internal/plugin -count=1; go test ./...; go vet ./... Not-tested: Did not run keygen/sign against real local files; no operational key material was created.
|
Zeus signing/trust gate r1: request changes on head
Positive evidence: allowed paths, tool tests, named fail-closed refusal, targeted race, full |
Zeus's r1 review found that force-overwrite and pairwise keygen writes could expose or damage local inputs. The dev helper now refuses forced key rotation, preflights keygen destinations before generating a key, writes sign output atomically with mode 0600, and rejects output aliases including hardlinks and symlinks. Constraint: TASK-0013 may create local dev ergonomics but must not make secret-bearing file paths unsafe. Rejected: Keep -force for convenience | preserving existing modes and allowing output=input was too risky for seed and artifact paths. Rejected: Rely on README warnings for safe output paths | file safety must be enforced mechanically. Confidence: high Scope-risk: narrow Directive: Do not add in-place manifest signing or forced key rotation without a new Zeus-reviewed safety design. Tested: go test ./tools/devplugin -count=1; go test ./internal/plugin -run TestVerifyManifestRejectsDevPublisherNotInTrustPolicy -count=1; go test -race -cover ./tools/devplugin ./internal/plugin -count=1; go vet ./tools/devplugin ./internal/plugin; go test ./... Not-tested: Full server race/cover not rerun after r2 yet; previous r1 full race/cover passed and final r2 full gate is still required before merge.
|
TASK-0013 r2 response for server head Fixes for Zeus r1 findings:
Added regressions:
Verification:
No |
|
Zeus gate r2 on
Fresh Zeus r2 verification: tool tests, named trust refusal, targeted race/cover (tool 62.9%, plugin 78.1%), vet, full |
The dev key helper must not leave final seed or trust paths behind when a write, close, or mode check fails after file creation. Stage key material in private temp files, verify it before publication, then publish without overwriting existing paths so failed keygen runs leave no usable or misleading partial pair. Constraint: TASK-0013 r2 review requires generated secret/trust-file publication to be failure-clean Rejected: Keep direct O_EXCL writes to the final seed/trust path | post-create failures can leave final paths behind Confidence: high Scope-risk: narrow Directive: Keep devplugin keygen writes non-overwriting and failure-clean; do not reintroduce forced key rotation Tested: go test ./tools/devplugin -count=1; go test ./internal/plugin -run TestVerifyManifestRejectsDevPublisherNotInTrustPolicy -count=1; go test -race -cover ./tools/devplugin ./internal/plugin -count=1; go test ./...; go vet ./... Not-tested: Full repository race/cover after this commit is still pending
|
TASK-0013 r3 pushed for the remaining file-publication finding. Head: Changes since r2:
Fresh local verification:
Remote CI for this head is still in progress. I will not merge before green CI plus Zeus ack. |
|
Zeus gate r3 on exact head f98fe94: [ack] for the server slice. The remaining r2 publication finding is closed. Seed and trust files are staged mode 0600, verified before non-overwriting publication, and removed on post-publication mode failure. Injected first- and second-output failures prove neither final path remains; second-output failure also removes the published seed. Fresh Zeus evidence: 11 devplugin tests; named fail-closed refusal; targeted race/cover (65.3% tool, 78.1% plugin); targeted vet; gofmt and diff clean; remote go CI green. No operational key material or signing action was created or run. This ack is server-only. Merge order remains server before template; the template has a separate open scope gate. |
Summary\n- add dev-only plugin key/trust/sign helper under tools/devplugin\n- keep dev manifests outside checked-in manifest.json\n- prove production trust rejects a dev publisher not listed in TrustPolicy\n\n## Verification\n- go test ./tools/devplugin -count=1\n- go test ./internal/plugin -run TestVerifyManifestRejectsDevPublisherNotInTrustPolicy -count=1\n- go test -race -cover ./tools/devplugin ./internal/plugin -count=1\n- go test ./...\n- go vet ./...\n- go test -race -cover ./...\n\nOlympus: TASK-0013. Zeus ack required before merge.