checkwright 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +385 -19
- package/lib/common/digest.sh +18 -0
- package/lib/common/lock.sh +11 -0
- package/lib/common/recipe.sh +8 -11
- package/lib/doctor.sh +49 -0
- package/lib/init.sh +152 -29
- package/package.json +2 -2
- package/payload/artifact/targets.list +30 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
- package/payload/canon-kit/README.md +1 -0
- package/payload/canon-kit/SPEC.md +281 -26
- package/payload/canon-kit/checks/check-comment-tier.sh +7 -2
- package/payload/canon-kit/checks/check-docs-link-convention.sh +11 -4
- package/payload/canon-kit/checks/check-md-refs.sh +22 -9
- package/payload/canon-kit/checks/check-payload-claim.sh +133 -0
- package/payload/canon-kit/checks/check-prose-enum.sh +1 -1
- package/payload/canon-kit/checks/check-spec-pointer.sh +15 -4
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +26 -3
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
- package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +5 -3
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +24 -1
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
- package/payload/canon-kit/lib/spec.sh +22 -12
- package/payload/canon-kit/smoke/install.sh +20 -1
- package/payload/canon-kit/templates/SPEC-amendment.md +5 -1
- package/payload/context-kit/SPEC.md +38 -7
- package/payload/context-kit/lib/toolfloor.sh +1 -1
- package/payload/context-kit/smoke/install.sh +3 -1
- package/payload/delegation-kit/README.md +2 -1
- package/payload/delegation-kit/SPEC.md +590 -48
- package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +61 -0
- package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -1
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/silent.md +7 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/args +1 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/expect.txt +1 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-cheap.md +7 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-inherit.md +8 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/args +1 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/expect.txt +1 -0
- package/payload/delegation-kit/lib/delegation.sh +3 -0
- package/payload/delegation-kit/smoke/install.sh +3 -1
- package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
- package/payload/delegation-kit/templates/agent-execution.md +171 -15
- package/payload/delegation-kit/templates/delegation-config.sh +4 -0
- package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
- package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
- package/payload/doctrine-kit/DOCTRINE.md +27 -0
- package/payload/doctrine-kit/README.md +5 -0
- package/payload/doctrine-kit/SPEC.md +62 -3
- package/payload/doctrine-kit/bin/install-doctrine.sh +84 -4
- package/payload/doctrine-kit/smoke/install.sh +77 -1
- package/payload/drift-kit/README.md +3 -2
- package/payload/drift-kit/SPEC.md +253 -20
- package/payload/drift-kit/bin/stage-economics.sh +157 -3
- package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
- package/payload/drift-kit/smoke/install.sh +155 -1
- package/payload/drift-kit/templates/economics.md +9 -0
- package/payload/drift-kit/templates/kpis.list +6 -1
- package/payload/evidence-kit/README.md +20 -6
- package/payload/evidence-kit/SPEC.md +355 -17
- package/payload/evidence-kit/bin/run-validate.sh +51 -9
- package/payload/evidence-kit/checks/check-battery-roster.sh +86 -0
- package/payload/evidence-kit/checks/check-producer-liveness.sh +34 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
- package/payload/evidence-kit/lib/evidence.sh +18 -0
- package/payload/evidence-kit/smoke/install.sh +17 -3
- package/payload/gate-sdk/README.md +4 -1
- package/payload/gate-sdk/SPEC.md +1955 -79
- package/payload/gate-sdk/bin/gen-pre-commit.sh +13 -3
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +121 -1
- package/payload/gate-sdk/bin/run-gate-tests.sh +40 -9
- package/payload/gate-sdk/bin/run-gates.sh +32 -3
- package/payload/gate-sdk/bin/upgrade-smoke.sh +3 -3
- package/payload/gate-sdk/checks/check-action-gh-repo.gate +2 -0
- package/payload/gate-sdk/checks/check-action-pinning.gate +2 -0
- package/payload/gate-sdk/checks/check-action-run-shell.sh +3 -1
- package/payload/gate-sdk/checks/check-core-files.sh +27 -4
- package/payload/gate-sdk/checks/check-exec-bit.sh +20 -1
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +106 -0
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +6 -7
- package/payload/gate-sdk/checks/check-gate-output.sh +9 -1
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +302 -0
- package/payload/gate-sdk/checks/check-graph.sh +7 -8
- package/payload/gate-sdk/checks/check-readme-roster.sh +5 -0
- package/payload/gate-sdk/checks/check-reads-couples.sh +73 -22
- package/payload/gate-sdk/checks/check-template-registry-parity.sh +81 -0
- package/payload/gate-sdk/checks/check-tree-terms.sh +11 -7
- package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
- package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +123 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +41 -1
- package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
- package/payload/gate-sdk/lib/consumer-smoke.sh +26 -1
- package/payload/gate-sdk/lib/gate.sh +104 -13
- package/payload/gate-sdk/lib/inject.sh +21 -1
- package/payload/gate-sdk/smoke/install.sh +19 -1
- package/payload/guard-kit/README.md +4 -3
- package/payload/guard-kit/SPEC.md +88 -10
- package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
- package/payload/guard-kit/lib/guard.sh +1 -0
- package/payload/guard-kit/templates/close-triage.md +35 -7
- package/payload/guard-kit/templates/guard-config.sh +3 -0
- package/payload/lifecycle-kit/README.md +1 -0
- package/payload/lifecycle-kit/SPEC.md +589 -33
- package/payload/lifecycle-kit/bin/enter-stage.sh +13 -3
- package/payload/lifecycle-kit/bin/file-gap.sh +42 -1
- package/payload/lifecycle-kit/bin/file-survey.sh +50 -0
- package/payload/lifecycle-kit/checks/check-merge-attrs.sh +1 -1
- package/payload/lifecycle-kit/checks/check-skill-binding.sh +1 -1
- package/payload/lifecycle-kit/checks/check-survey-record.sh +102 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +1 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +84 -0
- package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +94 -0
- package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
- package/payload/lifecycle-kit/lib/stages.sh +8 -2
- package/payload/lifecycle-kit/smoke/install.sh +17 -1
- package/payload/lifecycle-kit/templates/consult.md +73 -0
- package/payload/lifecycle-kit/templates/lead.md +141 -10
- package/payload/lifecycle-kit/templates/stages/align.md +12 -0
- package/payload/lifecycle-kit/templates/stages/build.md +8 -0
- package/payload/lifecycle-kit/templates/stages/close.md +25 -4
- package/payload/lifecycle-kit/templates/stages/scope.md +34 -0
- package/payload/lifecycle-kit/templates/stages/spec.md +8 -0
- package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
- package/payload/queue-kit/README.md +4 -1
- package/payload/queue-kit/SPEC.md +230 -6
- package/payload/queue-kit/bin/queue-edges.sh +78 -0
- package/payload/queue-kit/checks/check-queue-entry-budget.sh +5 -3
- package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
- package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
- package/payload/queue-kit/smoke/install.sh +4 -1
- package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
- package/payload/site-kit/SPEC.md +135 -29
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +100 -27
- package/payload/site-kit/gate-tests/check-docs-render-fidelity-batch.test.sh +158 -0
- package/payload/site-kit/lib/site.sh +16 -2
- package/payload/site-kit/smoke/install.sh +9 -1
- package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
- package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
|
@@ -46,6 +46,10 @@ Knobs, this repo's surface names as defaults:
|
|
|
46
46
|
- `EVIDENCE_KIT_BASELINE_FILE` (default `.workflow/validate-baseline.txt`),
|
|
47
47
|
`EVIDENCE_KIT_MANIFEST_FILE` (default `.workflow/validate-evidence.txt`),
|
|
48
48
|
`EVIDENCE_KIT_SKIP_FILE` (default `.workflow/validate-skips.txt`).
|
|
49
|
+
- `EVIDENCE_KIT_LOCK_FILE` — the producer-liveness lock (§The producer-liveness
|
|
50
|
+
lock), default `run-validate.lock` under `EVIDENCE_KIT_TMP_DIR`. It resolves
|
|
51
|
+
*through* the scratch knob rather than beside it, so a consumer that moves the
|
|
52
|
+
scratch dir moves the lock with it and never has to keep two paths in step.
|
|
49
53
|
- `EVIDENCE_KIT_QUEUE_FILE` / `EVIDENCE_KIT_STATE_FILE` — the lifecycle surfaces
|
|
50
54
|
read for the manifest's optional close-entry and stamp-coupling assertions;
|
|
51
55
|
they default through gate-sdk's `GATE_SDK_QUEUE_FILE` / `GATE_SDK_WORKFLOW_DIR`.
|
|
@@ -55,15 +59,26 @@ Knobs, this repo's surface names as defaults:
|
|
|
55
59
|
regen, container teardown) kept on the consumer side of the spine.
|
|
56
60
|
- `EVIDENCE_KIT_PERMANENT_SLUGS` — blocking slugs that satisfy baseline liveness
|
|
57
61
|
without a live queue task.
|
|
62
|
+
- `EVIDENCE_KIT_RUNNER_DOC` (default `README.md`, resolved against the git
|
|
63
|
+
toplevel) — the doc whose battery-roster block `check-battery-roster` holds
|
|
64
|
+
against the suite roster. It is gate-local: nothing in the validate run path
|
|
65
|
+
reads it, so the loader fills no default for it and the gate carries its own.
|
|
66
|
+
The name mirrors gate-sdk's `GATE_SDK_RUNNER_DOC` deliberately — in a tree
|
|
67
|
+
vendoring both kits the two name the same physical doc for two different
|
|
68
|
+
assertions, and a reader who has met one should not have to learn a second
|
|
69
|
+
vocabulary for the other.
|
|
58
70
|
|
|
59
71
|
## Per-component contracts
|
|
60
72
|
|
|
61
73
|
### lib/evidence.sh
|
|
62
74
|
|
|
63
75
|
The sourced config loader: consumer config first, kit defaults fill what it
|
|
64
|
-
left unset, then validation. It also owns the shared adapters — `
|
|
76
|
+
left unset, then validation. It also owns the shared adapters — `ek_suite_cmd`
|
|
77
|
+
(a suite's configured run command, `EVIDENCE_KIT_RUN_<suite>`), `ek_parser_for`
|
|
78
|
+
(the per-suite parser resolution, detailed below), `ek_parse` (the
|
|
65
79
|
parser dispatch), `ek_diff` (the per-scenario baseline diff, §bin/diff-baseline.sh),
|
|
66
|
-
`ek_data_lines`,
|
|
80
|
+
`ek_data_lines`, the `ek_pid_alive` / `ek_lock_read` lock adapters
|
|
81
|
+
(§The producer-liveness lock), and the self-contained `ek_queue_iteration` / `ek_run_key`
|
|
67
82
|
header readers plus the `ek_state_stage` cursor reader that let the kit read
|
|
68
83
|
lifecycle state without a lifecycle-kit dependency. The two axes come from two
|
|
69
84
|
surfaces: the queue header names the iteration, the state file's **last data
|
|
@@ -130,16 +145,40 @@ absent from the baseline falls under the classification-cost rule.
|
|
|
130
145
|
|
|
131
146
|
### Evidence manifest
|
|
132
147
|
|
|
133
|
-
Committed,
|
|
148
|
+
Committed, written once per run. The file header is a `# contract: evidence-manifest v1`
|
|
134
149
|
line — the versioned wire format the deferred hosted-attestation service consumes
|
|
135
150
|
as its attestation payload. Each data line is
|
|
136
151
|
`<iteration> <suite> sha256=<log-hash> pass=<n> fail=<n> ignore=<n>
|
|
137
|
-
verdict=<clean|new-failures> <date>`, and a
|
|
138
|
-
|
|
152
|
+
verdict=<clean|new-failures> <date>`, and a run supersedes that iteration's
|
|
153
|
+
prior line for every suite it ran. The captured log
|
|
139
154
|
stays uncommitted under the tmp dir; its digest pins which run produced the
|
|
140
155
|
counts. The iteration key scopes the line so the boundary-truncate knob can
|
|
141
156
|
clear the manifest at the start of the next iteration.
|
|
142
157
|
|
|
158
|
+
**The spine touches this file only after its last suite has run**, and that is
|
|
159
|
+
contract rather than implementation detail. `run-validate` accumulates its rows
|
|
160
|
+
under the tmp dir and folds them in as a single write, dropping this iteration's
|
|
161
|
+
prior line for each suite the run covered and re-appending the batch in
|
|
162
|
+
configured-suite order.
|
|
163
|
+
|
|
164
|
+
What that buys is a suite free to sit anywhere in the roster even when its own
|
|
165
|
+
precondition is a clean worktree. A spine writing per suite dirties the tree
|
|
166
|
+
before such a suite's turn, so every full run reddens it for no reason but
|
|
167
|
+
roster position — a collision the writer manufactures and no suite can defend
|
|
168
|
+
itself against. Pinning it to the front of the roster is mitigation, not a fix:
|
|
169
|
+
nothing asserts the position, so a second such suite re-breaks it silently.
|
|
170
|
+
Under one fold nothing pins any suite anywhere.
|
|
171
|
+
|
|
172
|
+
Line order follows the configured roster rather than run history, so a repeat
|
|
173
|
+
run rewrites this iteration's rows where they already were instead of relocating
|
|
174
|
+
each to the end — a run whose counts and date are unchanged leaves the file
|
|
175
|
+
byte-identical, and a concurrent or repeated producer stops surfacing as a diff
|
|
176
|
+
with no content behind it. An aborted run writes nothing: it leaves the manifest
|
|
177
|
+
as it found it, which is what the abort's own diagnostic already claims. The
|
|
178
|
+
partial manifest that used to survive such an abort was never admissible anyway —
|
|
179
|
+
§check-evidence-manifest's close-entry assertion wants a clean line for every
|
|
180
|
+
configured suite.
|
|
181
|
+
|
|
143
182
|
The header is a wire-format version marker, not a doc pointer —
|
|
144
183
|
gate-sdk/SPEC.md §The workflow directory rules that as one of the two payload
|
|
145
184
|
forms a checked projection may carry, and this section is the statement that
|
|
@@ -149,15 +188,155 @@ form requires. `check-evidence-manifest` owns it (asserts the first line is
|
|
|
149
188
|
(`CANON_KIT_COMMENT_WHITELIST`), since a version marker resolves as no path; the
|
|
150
189
|
baseline is pointer-form and needs no whitelist entry.
|
|
151
190
|
|
|
191
|
+
### The producer-liveness lock
|
|
192
|
+
|
|
193
|
+
Uncommitted, under `EVIDENCE_KIT_LOCK_FILE`. A stage stamp proves invocation and
|
|
194
|
+
an evidence line proves a green result, but neither can say a producer is *still
|
|
195
|
+
running* — a file read at an instant cannot carry that, and the manifest's own
|
|
196
|
+
guarantees do not reach it: §check-evidence-manifest's assertion A already
|
|
197
|
+
asserts suite-roster completeness at a close cursor, and the spine's single fold
|
|
198
|
+
means a torn read is unreachable. The gap is liveness alone, and the lock is the
|
|
199
|
+
artifact that closes it.
|
|
200
|
+
|
|
201
|
+
The record is one line, `pid=<n> run=<key>`, where `<key>` is the evidence-line
|
|
202
|
+
key `ek_run_key` yields. Both fields have named readers and nothing else is
|
|
203
|
+
carried: a start timestamp was considered and removed, because once the stale
|
|
204
|
+
policy is PID-liveness rather than age it has no reader, and a field with no
|
|
205
|
+
reader is removed rather than kept for plausibility.
|
|
206
|
+
|
|
207
|
+
**The lock is held if and only if the recorded PID is alive**, which makes a
|
|
208
|
+
leaked lock self-invalidating — the shape this methodology already relies on for
|
|
209
|
+
the session-role marker, whose id match means a stale marker self-invalidates.
|
|
210
|
+
An **age-based TTL is rejected outright**: a long validate run outlives any
|
|
211
|
+
honest TTL, and a long run is precisely the case the lock exists for, so a TTL
|
|
212
|
+
tuned short enough to reclaim a crashed run promptly is guaranteed to declare a
|
|
213
|
+
healthy long run dead — restoring the false-green the lock removes.
|
|
214
|
+
|
|
215
|
+
`ek_pid_alive` is the one predicate all three readers share, and its two legs are
|
|
216
|
+
a ruling rather than belt-and-braces. `kill -0` is the cheap same-uid answer, but
|
|
217
|
+
it conflates *no such process* with *not yours*: against a producer running under
|
|
218
|
+
another uid it reports the live process as dead, which is a false **free**
|
|
219
|
+
reading — the one direction this design may not take. `ps -p` answers existence
|
|
220
|
+
without needing the permission to signal, so it runs as the fallback and any
|
|
221
|
+
evidence of existence means held. Reading `/proc` to confirm process *identity*
|
|
222
|
+
is rejected separately: it is unportable, and the OS-reach objective makes a
|
|
223
|
+
Linux-only predicate a cost rather than a refinement.
|
|
224
|
+
|
|
225
|
+
**PID reuse is a named, accepted residual.** A recycled PID yields a false
|
|
226
|
+
*held* reading, which refuses a stage entry that could have proceeded — a
|
|
227
|
+
fail-closed direction costing one file deletion to clear, against a defect that
|
|
228
|
+
would otherwise cost the next session an evidence file changing underneath it.
|
|
229
|
+
The same direction reaches the writer's own refusal, which reads the identical
|
|
230
|
+
predicate: a recycled PID makes `run-validate` over-refuse by the same
|
|
231
|
+
mechanism. One cause, one direction, one clearance — a restated instance of the
|
|
232
|
+
residual, not a second one to weigh.
|
|
233
|
+
|
|
234
|
+
**The claim is atomic create-exclusive, never check-then-write**, and the
|
|
235
|
+
asserted property is two-part: it succeeds for exactly one producer, *and* the
|
|
236
|
+
record publishes whole. The idiom is the one the spine already uses to publish
|
|
237
|
+
the manifest — build the record in a temp file under the same scratch dir, then
|
|
238
|
+
`ln` it into place, which fails if the target exists. `mkdir` and a `set -C`
|
|
239
|
+
redirect are atomic on the first half only: each leaves a window where the lock
|
|
240
|
+
exists and its record does not, which every reader would then have to parse
|
|
241
|
+
around. Because the record publishes whole, a reader never has to interpret a
|
|
242
|
+
partial lock or decide what an empty one means, so an unparseable lock is
|
|
243
|
+
corruption and fails closed rather than reading free.
|
|
244
|
+
|
|
245
|
+
The atomicity is *required* rather than careful, and what makes it so is the
|
|
246
|
+
writer-side refusal (§bin/run-validate.sh). An unconditional claim has no
|
|
247
|
+
predicate and so no time-of-check window; adding the refusal adds one, and a
|
|
248
|
+
naive read-then-claim would let two producers both observe a clear lock and both
|
|
249
|
+
claim, the second's record overwriting the first's. That reintroduces exactly
|
|
250
|
+
the two-producer case the refusal exists to close, and defeats conditional
|
|
251
|
+
release with it — "still ours" cannot be answered from a record another producer
|
|
252
|
+
overwrote. The claim's success *is* the check, so there is no interval between
|
|
253
|
+
them to lose.
|
|
254
|
+
|
|
255
|
+
**The release is conditional — remove only if the lock is still ours.** The
|
|
256
|
+
`EXIT` trap compares the recorded PID against the running shell's and removes
|
|
257
|
+
nothing on a mismatch. An unconditional `rm -f` reproduces this artifact's own
|
|
258
|
+
defect inside its own mechanism: the lock is single-holder, so with an
|
|
259
|
+
unconditional claim *and* an unconditional release whichever producer exits
|
|
260
|
+
first deletes the survivor's lock, after which a preflight reads free with a
|
|
261
|
+
producer still live. Atomicity does not make the condition redundant, and the
|
|
262
|
+
residual it closes is **not** the `EXIT`-trap race it first suggests: a trap runs
|
|
263
|
+
synchronously as part of its process's own exit and completes before that
|
|
264
|
+
process reads as dead, and the one exception — `SIGKILL` — skips the trap
|
|
265
|
+
entirely rather than deferring it. So a producer correctly identified as stale
|
|
266
|
+
cannot later run its trap. The case that remains is a lock removed by some path
|
|
267
|
+
*other than* the reclaim below — an operator deleting an apparently-stuck lock,
|
|
268
|
+
or a future code path: producer A is still alive and unaware, producer B claims
|
|
269
|
+
the freed slot, and A's unconditional release would delete B's live lock.
|
|
270
|
+
Atomicity is what makes "still ours" *answerable*; conditional release is what
|
|
271
|
+
acts on the answer.
|
|
272
|
+
|
|
273
|
+
The reclaim path a runtime artifact owes is three layers, and all three are
|
|
274
|
+
asserted: the `EXIT` trap, which covers every exit path the spine has; the
|
|
275
|
+
readers' PID-liveness predicate, which makes a leaked file inert; and the
|
|
276
|
+
consumer's scratch-boundary wipe, which removes it. No close-surface declaration
|
|
277
|
+
is owed — that obligation attaches to capture-tier members of the workflow
|
|
278
|
+
directory, and this lock lives in the scratch tier.
|
|
279
|
+
|
|
280
|
+
**evidence-kit owns the lock at both ends; lifecycle-kit contributes only the
|
|
281
|
+
hook it already ships.** The lock is a property of the *producer's run*, and this
|
|
282
|
+
kit owns the producer and the scratch directory it lives under. The reader need
|
|
283
|
+
not live in lifecycle-kit: `LIFECYCLE_KIT_ENTRY_PREFLIGHT` is already a generic
|
|
284
|
+
per-stage hook naming no evidence surface, so a second evidence-kit gate on that
|
|
285
|
+
roster adds no new cross-kit dependency at all — the consumer wires it exactly as
|
|
286
|
+
it already wires the manifest gate (§lifecycle-kit integration). The rejected
|
|
287
|
+
alternative is worth recording: a lock held by lifecycle-kit would force that kit
|
|
288
|
+
to know this one's scratch knob — a downward dependency onto one specific
|
|
289
|
+
producer kit — and would generalize wrongly, since lifecycle-kit would then have
|
|
290
|
+
to model every possible producer's lock rather than one hook any producer's gate
|
|
291
|
+
can hang from.
|
|
292
|
+
|
|
152
293
|
### bin/run-validate.sh
|
|
153
294
|
|
|
154
|
-
The codified spine
|
|
295
|
+
The codified spine, bounded by the producer-liveness lock: the guards, the
|
|
296
|
+
claim, then the optional per-suite pre-hook and each suite run
|
|
155
297
|
foreground, parsed, diffed against the baseline's suite slice per-scenario, and
|
|
156
|
-
recorded as one
|
|
157
|
-
finds a new failure.
|
|
298
|
+
recorded as one evidence line whose verdict is `clean` unless the diff
|
|
299
|
+
finds a new failure. The lines batch under the tmp dir and reach the manifest in
|
|
300
|
+
the single fold §Evidence manifest rules, so a suite never runs against a tree
|
|
301
|
+
the spine has already written to. It never edits the baseline, never retries, and surfaces a
|
|
158
302
|
non-zero suite exit verbatim. A log with no parseable result is a run failure,
|
|
159
|
-
not an empty diff.
|
|
160
|
-
|
|
303
|
+
not an empty diff. Not a gate — a `bin/` tool exercised end-to-end in `smoke/`,
|
|
304
|
+
with the lock's own behavior pinned by `gate-tests/producer-lock.test.sh`.
|
|
305
|
+
|
|
306
|
+
**The claim's placement is asserted, not left to the implementer**: after the
|
|
307
|
+
preflight guards and the scratch `mkdir` — a run that refuses to start must not
|
|
308
|
+
claim — and before the batch file is created, so no evidence work happens
|
|
309
|
+
outside the lock's cover. Release is the `EXIT` trap, conditional on the record
|
|
310
|
+
still being ours (§The producer-liveness lock owns both properties and the
|
|
311
|
+
reasons they are load-bearing). A trap rather than a tail line, because the
|
|
312
|
+
script exits from many guard and fail-closed sites besides its terminal exit, and
|
|
313
|
+
a tail-line release would leak the lock on every failure path — the population
|
|
314
|
+
that matters most, since a crashed run is exactly when a stale lock appears. The
|
|
315
|
+
idiom precedent is `lifecycle-kit/bin/enter-stage.sh`, which claims temp files
|
|
316
|
+
under a scratch dir with an `EXIT` trap.
|
|
317
|
+
|
|
318
|
+
**It refuses to start while a live lock is held**, and the refusal falls out of
|
|
319
|
+
the atomic claim rather than being a second mechanism: the claim either succeeds
|
|
320
|
+
— in which case no holder existed — or fails, and the failure branch is the
|
|
321
|
+
refusal. On a failed claim it reads the existing lock; a **live** PID refuses
|
|
322
|
+
immediately, naming the blocking run key, with no reclaim attempted. A **dead**
|
|
323
|
+
PID (or a lock that has vanished since the claim failed) is reclaimed by removing
|
|
324
|
+
the lock and retrying **exactly once**; a second failure refuses rather than
|
|
325
|
+
looping, which resolves the two-contender stale case without an unbounded retry —
|
|
326
|
+
both contenders may remove and relink, exactly one `ln` succeeds, and the loser's
|
|
327
|
+
re-read finds a live PID. A lock that does not parse refuses outright.
|
|
328
|
+
|
|
329
|
+
This is why the tool has **two** non-zero exits with different meanings: exit 1
|
|
330
|
+
when a suite records `new-failures` — the verdict — and the guards' exit 2 when
|
|
331
|
+
the run cannot start at all, which a held or unclaimable lock now joins. The
|
|
332
|
+
refusal is a start-time verdict about the world, not a result, so it takes the
|
|
333
|
+
guards' code and not the verdict's.
|
|
334
|
+
|
|
335
|
+
The reason a producer that never enters a stage is worth guarding is that the
|
|
336
|
+
entry-side reader cannot see it: a session can run this tool without entering a
|
|
337
|
+
stage, so an entry-side red alone would leave two producers able to race the
|
|
338
|
+
manifest with every stage entry green. A lock the producer itself does not check
|
|
339
|
+
is not a mutex.
|
|
161
340
|
|
|
162
341
|
### bin/diff-baseline.sh
|
|
163
342
|
|
|
@@ -206,6 +385,119 @@ Argument mode `$1 $2 $3` (manifest, queue, state) makes it fixture-capable; the
|
|
|
206
385
|
close-entry and stamp-coupling assertions are covered by
|
|
207
386
|
`gate-tests/check-evidence-manifest.test.sh`.
|
|
208
387
|
|
|
388
|
+
### check-battery-roster
|
|
389
|
+
|
|
390
|
+
Invariant: the configured runner doc's battery-roster block holds name-set
|
|
391
|
+
parity with `EVIDENCE_KIT_SUITES`, both directions. The suite roster is
|
|
392
|
+
machine-owned and the doc block is a hand copy of it — the
|
|
393
|
+
`check-readme-roster` fork (gate-sdk/SPEC.md §check-readme-roster) applied to
|
|
394
|
+
the validate battery: the register stays a human-read list carrying per-line
|
|
395
|
+
annotation prose an emitter would have to invent, and a gate holds it honest
|
|
396
|
+
rather than generating it.
|
|
397
|
+
|
|
398
|
+
Marker vocabulary follows that gate verbatim in shape: the doc wraps its
|
|
399
|
+
register in `<!-- battery-roster:begin -->` / `<!-- battery-roster:end -->`
|
|
400
|
+
markers, which may carry leading indentation (the scan trims surrounding
|
|
401
|
+
whitespace before matching, since a README nests the block inside a list item).
|
|
402
|
+
Inside the markers a **roster line** is a line whose content begins with a bare
|
|
403
|
+
lowercase command word (`bash …`, `cargo …`) — the interpreter is not part of
|
|
404
|
+
the grammar, so a suite whose runner is not a shell script is rosterable without
|
|
405
|
+
widening a literal each time; the fenced-block delimiters and any prose fail the
|
|
406
|
+
match by not starting with a lowercase letter. A trailing `#` annotation clause
|
|
407
|
+
is prose the gate never reads.
|
|
408
|
+
Outside the markers nothing is scanned, so the same command appearing elsewhere
|
|
409
|
+
in the doc for a different rhetorical job neither satisfies nor violates the
|
|
410
|
+
gate — which is why the block, not the whole doc, is the unit.
|
|
411
|
+
|
|
412
|
+
A suite's **documented invocation** is `EVIDENCE_KIT_RUN_<suite>` normalized by
|
|
413
|
+
stripping a leading `env` token and any leading `VAR=value` assignments, with
|
|
414
|
+
or without that token: the run environment is a validate-harness concern (this
|
|
415
|
+
repo's `gates` suite runs under gate-sdk's `GATE_SDK_VERBOSE` knob, whose value
|
|
416
|
+
that kit's SPEC owns, to emit the per-gate tails its parser reads) and not
|
|
417
|
+
something a contributor types. What remains is
|
|
418
|
+
compared as an exact string, whitespace-collapsed on both sides so the block's
|
|
419
|
+
annotation alignment carries no meaning.
|
|
420
|
+
|
|
421
|
+
Two assertions over the suite set versus the roster set:
|
|
422
|
+
|
|
423
|
+
- **(A) every suite is documented** — a member of `EVIDENCE_KIT_SUITES` whose
|
|
424
|
+
normalized invocation matches no roster line is red;
|
|
425
|
+
- **(B) every roster line resolves to a suite** — a roster line whose command
|
|
426
|
+
matches no suite's normalized invocation is red, so a retired suite cannot
|
|
427
|
+
leave a stale line telling a contributor to run a command that is not a
|
|
428
|
+
configured suite.
|
|
429
|
+
|
|
430
|
+
Each finding names the suite (A) or the command and its line (B), and the doc.
|
|
431
|
+
A suite with no `EVIDENCE_KIT_RUN_<suite>` configured has no documented
|
|
432
|
+
invocation to compare and is passed over: `bin/run-validate.sh` already exits 2
|
|
433
|
+
on it, and reporting it here would send the reader to the doc to fix a config
|
|
434
|
+
bug.
|
|
435
|
+
|
|
436
|
+
The overlap with `check-kit-registration` assertion B (gate-sdk/SPEC.md
|
|
437
|
+
§check-kit-registration) is deliberate. That assertion requires every kit root
|
|
438
|
+
with tracked `gate-tests/` files to have a runner-doc line naming
|
|
439
|
+
`<kit>/gate-tests`; because this repo's config derives exactly those roots into
|
|
440
|
+
`EVIDENCE_KIT_SUITES` through `gate_fixture_suites`, assertion (A) here is a
|
|
441
|
+
superset of that arm for a consumer running both kits. It is kept rather than
|
|
442
|
+
retired on a dependency direction: a gate-sdk gate may not require this kit's
|
|
443
|
+
config — gate-sdk's `bin/enforcement-map.sh` reads the suite roster where a
|
|
444
|
+
consumer has one, but an assertion cannot, having no honest verdict when it is
|
|
445
|
+
absent. So B is the arm that survives a gate-sdk-only adoption, which is the
|
|
446
|
+
more common shape. Both sections say so, each naming the other, so the next
|
|
447
|
+
reader who notices the redundancy finds the reason instead of re-deriving it.
|
|
448
|
+
One omission reported from both sides is a duplicate finding, not a
|
|
449
|
+
contradiction — the two name different sets (a kit root, a suite) in their
|
|
450
|
+
output.
|
|
451
|
+
|
|
452
|
+
Config: `EVIDENCE_KIT_RUNNER_DOC` (§Layout and configuration); positional form
|
|
453
|
+
`check-battery-roster.sh [runner-doc]` overrides it against a hermetic fixture
|
|
454
|
+
tree, the sibling meta-gates' shape. Fail-closed: a configured doc that does not
|
|
455
|
+
exist, a doc carrying no marker block, an empty suite roster, or a non-repo cwd
|
|
456
|
+
with no positional argument is a misconfiguration (exit 2), never a false clean.
|
|
457
|
+
There is no empty-knob valve — a consumer keeping no runner doc opts out by not
|
|
458
|
+
registering the gate in its `gates.list`, gate-sdk's registry opt-out shape. The
|
|
459
|
+
fail-closed branches and the normalization arms beyond the one good/bad pair are
|
|
460
|
+
covered by `gate-tests/check-battery-roster.test.sh`.
|
|
461
|
+
|
|
462
|
+
### check-producer-liveness
|
|
463
|
+
|
|
464
|
+
Invariant: no stage entry while the evidence producer is still running. It reads
|
|
465
|
+
`EVIDENCE_KIT_LOCK_FILE` and is green when the lock is absent or names a dead
|
|
466
|
+
PID, red when it names a live one — printing the blocking run key, so the
|
|
467
|
+
operator can tell *wait for that run* from *reclaim a lock whose owner is gone*.
|
|
468
|
+
A lock that does not parse is exit 2: the claim publishes the record whole
|
|
469
|
+
(§The producer-liveness lock), so an unparseable lock is corruption and never a
|
|
470
|
+
free reading.
|
|
471
|
+
|
|
472
|
+
This is a new gate rather than a fourth assertion on `check-evidence-manifest`,
|
|
473
|
+
because that gate's charter is manifest *content* — the close-entry green block,
|
|
474
|
+
the grammar, the stamp coupling — and liveness is a different class. A separate
|
|
475
|
+
gate also earns its own fixture pair instead of widening an existing gate's
|
|
476
|
+
charter.
|
|
477
|
+
|
|
478
|
+
Argument mode `check-producer-liveness.sh [lock-file]` makes it fixture-capable
|
|
479
|
+
and is how the entry hook points it at the lock (§lifecycle-kit integration);
|
|
480
|
+
extra arguments are ignored, so the hook's trailing `<queue> <state>` argv passes
|
|
481
|
+
through harmlessly.
|
|
482
|
+
|
|
483
|
+
**It belongs on the entry hook and not in a `gates.list` battery**, and the
|
|
484
|
+
reason is structural rather than a matter of taste. Its subject is a transition —
|
|
485
|
+
*is a producer in flight right now* — where every battery member's subject is
|
|
486
|
+
tree state. A consumer whose validate roster includes its own gate battery (this
|
|
487
|
+
repo's does: the `gates` suite *is* the battery) would have `run-validate` invoke
|
|
488
|
+
this gate while holding the lock it just claimed, reddening every validate run
|
|
489
|
+
against its own record. The kit therefore ships the gate registered nowhere and
|
|
490
|
+
wired at the entry, which is also the honest reading of its argument mode: it
|
|
491
|
+
takes the lock path because its caller is a stage entry, not a whole-tree sweep.
|
|
492
|
+
|
|
493
|
+
The fixture pair carries the two static verdicts — a dead PID and a live one.
|
|
494
|
+
Its `bad/` case names PID 1, the one PID a checked-in fixture can assert the
|
|
495
|
+
liveness of on every platform, which is exactly what `ek_pid_alive`'s `ps -p`
|
|
496
|
+
leg makes reliable: under `kill -0` alone, an unprivileged run reads init as
|
|
497
|
+
dead and the case would silently invert. Everything the pair cannot hold — a
|
|
498
|
+
live PID the test itself owns, the unparseable-lock exit, and the writer-side
|
|
499
|
+
behavior — is covered by `gate-tests/producer-lock.test.sh`.
|
|
500
|
+
|
|
209
501
|
## lifecycle-kit integration
|
|
210
502
|
|
|
211
503
|
Integration is two generic knobs on lifecycle-kit's side of the seam, each
|
|
@@ -219,19 +511,43 @@ iteration starts with a manifest carrying only its contract header — which is
|
|
|
219
511
|
what makes assertion (B)'s foreign-iteration test able to catch a skipped
|
|
220
512
|
truncation.
|
|
221
513
|
|
|
222
|
-
`LIFECYCLE_KIT_ENTRY_PREFLIGHT`
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
514
|
+
`LIFECYCLE_KIT_ENTRY_PREFLIGHT` carries **both** of this kit's entry-side gates,
|
|
515
|
+
at three stage keys between them. `bin/enter-stage.sh` runs each matching entry
|
|
516
|
+
against the candidate temp state file (the prospective stamp appended) and the
|
|
517
|
+
live queue, appending that `<queue> <state>` argv to whatever the entry names, and
|
|
518
|
+
a non-zero exit refuses the entry with nothing written.
|
|
519
|
+
|
|
520
|
+
`check-evidence-manifest` is wired at `close=`, its command naming the manifest
|
|
521
|
+
(`close=…/check-evidence-manifest.sh <manifest>`),
|
|
522
|
+
so assertion (A)'s close-entry green-block check fires *before* the
|
|
523
|
+
stamp is written — the missing evidence becomes a refusal at the entry (pointing
|
|
524
|
+
at run-validate) instead of a self-referential deadlock at pre-commit, where the
|
|
229
525
|
`gates` suite that would produce the evidence re-runs this same red gate
|
|
230
526
|
against the already-stamped cursor. Belt-and-braces behind the validate
|
|
231
527
|
skill's run-validate wiring, not a replacement for it; for a consumer that
|
|
232
528
|
wires it, assertion (A)'s enforcement point moves one step earlier, from
|
|
233
529
|
commit to entry.
|
|
234
530
|
|
|
531
|
+
`check-producer-liveness` is wired at `close=` **and** `validate=`
|
|
532
|
+
(`<stage>=…/check-producer-liveness.sh <lock-file>`). `close=` is the case the
|
|
533
|
+
gate was filed for — a lead dispatching close into a still-running producer.
|
|
534
|
+
`validate=` is added because this roster is an exact per-stage match, and a
|
|
535
|
+
second validate batch entering while a first batch's `run-validate` is live is
|
|
536
|
+
the same hazard with a worse outcome: two producers folding the same manifest.
|
|
537
|
+
Which keys a consumer wires is config, not asserted kit behavior — a consumer
|
|
538
|
+
whose producer runs at another stage wires its own.
|
|
539
|
+
|
|
540
|
+
The **read-only `--simulate` mode inherits this gate with no extra wiring**, and
|
|
541
|
+
that is the highest-value consumer rather than a bookkeeping detail: it runs
|
|
542
|
+
every matching preflight entry, so a lead gating an expensive dispatch with a
|
|
543
|
+
simulated entry stops being blind to a live producer. It does **not** make a
|
|
544
|
+
dispatch rule redundant, and the boundary has to be stated or the pair reads as
|
|
545
|
+
over-built: a simulated entry remains an instantaneous read, so a producer that
|
|
546
|
+
starts a second later is still unseen, and the gate covers only producers that
|
|
547
|
+
claim this lock. A lead dispatching on artifact state is still dispatching on
|
|
548
|
+
artifact state — it merely has one more artifact. A dispatch rule governs what
|
|
549
|
+
the lead waits *for*; this gate narrows what survives being wrong about it.
|
|
550
|
+
|
|
235
551
|
The validate stage records evidence on a commit later than the entry stamp
|
|
236
552
|
(assertion C's re-arm scoping): the stamp proves invocation at entry, the
|
|
237
553
|
evidence line proves the green result once the suites have run.
|
|
@@ -243,6 +559,28 @@ evidence line proves the green result once the suites have run.
|
|
|
243
559
|
forward, by the hosted-attestation payload. Every field has a reader there:
|
|
244
560
|
iteration (A/C scoping), suite + verdict + counts (A's green-block test),
|
|
245
561
|
sha256 (audit pinning of the producing log), date (A's stamp-ordering floor).
|
|
562
|
+
- **Suite roster** (`EVIDENCE_KIT_SUITES` + `EVIDENCE_KIT_RUN_<suite>`) —
|
|
563
|
+
produced by consumer config, wholly or in part derived there; consumed by
|
|
564
|
+
`run-validate.sh` (what to run), by `check-evidence-manifest` (A's green
|
|
565
|
+
block), by `check-battery-roster` (the doc-parity compare), and — behind a
|
|
566
|
+
`declare -p` probe, so evidence-kit stays optional — by gate-sdk's
|
|
567
|
+
`bin/enforcement-map.sh`. Every one of them reads it by sourcing the config
|
|
568
|
+
through the loader rather than parsing the file, so a suite a derivation loop
|
|
569
|
+
adds is visible to all of them with no second parse to keep in step.
|
|
570
|
+
- **Producer-liveness lock** — produced by `run-validate.sh` at the claim point,
|
|
571
|
+
which sits on the ordinary path (the validate stage runs it, and it is the only
|
|
572
|
+
writer of the manifest); its enabling config carries a default in the loader, so
|
|
573
|
+
it resolves in every deployed configuration rather than only under a test
|
|
574
|
+
harness. Consumed by `check-producer-liveness` through the entry-preflight hook
|
|
575
|
+
and, inheriting it with no extra wiring, by that hook's read-only simulate mode.
|
|
576
|
+
Both fields have named readers at named transitions: `pid` at three — the gate
|
|
577
|
+
at the stage-entry transition, `run-validate` at run start on a failed claim
|
|
578
|
+
(the refusal), and its `EXIT` trap at release, compared against the running
|
|
579
|
+
shell to answer *is this still ours*; `run key` at the two transitions where a
|
|
580
|
+
refusal line is composed, whose reader is the operator standing at that refusal
|
|
581
|
+
choosing between waiting and reclaiming. Reclaimed by the `EXIT` trap, by the
|
|
582
|
+
readers' liveness predicate making a leak inert, and by the consumer's
|
|
583
|
+
scratch-boundary wipe.
|
|
246
584
|
- **Baseline line** — produced by human commits (initial seed, promotions);
|
|
247
585
|
consumed by `diff-baseline.sh` (the per-scenario diff) and
|
|
248
586
|
`check-evidence-baseline` (grammar, liveness, coverage).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# spec: evidence-kit/SPEC.md §bin/run-validate.sh — the codified validate spine: optional pre-hook, run each suite foreground, parse, diff the baseline slice per-scenario,
|
|
2
|
+
# spec: evidence-kit/SPEC.md §bin/run-validate.sh — the codified validate spine: optional pre-hook, run each suite foreground, parse, diff the baseline slice per-scenario, batch the evidence lines and fold them into the manifest once the whole roster has run. Never edits the baseline, never retries, surfaces a non-zero suite verbatim.
|
|
3
3
|
set -uo pipefail
|
|
4
4
|
|
|
5
5
|
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
@@ -26,6 +26,44 @@ mkdir -p "$EVIDENCE_KIT_TMP_DIR"
|
|
|
26
26
|
today="$(date +%F)"
|
|
27
27
|
overall=0
|
|
28
28
|
|
|
29
|
+
# spec: evidence-kit/SPEC.md §The producer-liveness lock — release only if the lock is still ours: an out-of-band removal lets a second producer claim the freed slot, and an unconditional rm would delete that live holder's record
|
|
30
|
+
lock_release() {
|
|
31
|
+
local holder
|
|
32
|
+
holder="$(ek_lock_read "$EVIDENCE_KIT_LOCK_FILE")" || return 0
|
|
33
|
+
[[ "${holder%% *}" == "$$" ]] && rm -f "$EVIDENCE_KIT_LOCK_FILE"
|
|
34
|
+
return 0
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
lock_refuse() {
|
|
38
|
+
rm -f "$lock_tmp"
|
|
39
|
+
echo "run-validate: $1" >&2
|
|
40
|
+
exit 2
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# spec: evidence-kit/SPEC.md §The producer-liveness lock — the claim sits after the guards and the scratch mkdir (a run that refuses to start must not claim) and before any evidence work; the record is built whole in a temp file and `ln`ed into place, so the claim is create-exclusive and the lock is never half-written
|
|
44
|
+
lock_tmp="$(mktemp "$EVIDENCE_KIT_TMP_DIR/run-validate-lock.XXXXXX")" || exit 2
|
|
45
|
+
printf 'pid=%s run=%s\n' "$$" "$key" >"$lock_tmp"
|
|
46
|
+
reclaimed=0
|
|
47
|
+
while ! ln "$lock_tmp" "$EVIDENCE_KIT_LOCK_FILE" 2>/dev/null; do
|
|
48
|
+
holder="$(ek_lock_read "$EVIDENCE_KIT_LOCK_FILE")"; hs=$?
|
|
49
|
+
if [[ "$hs" -eq 2 ]]; then
|
|
50
|
+
lock_refuse "the lock $EVIDENCE_KIT_LOCK_FILE carries no readable 'pid=<n> run=<key>' record — refusing to start; delete it if no producer is running"
|
|
51
|
+
fi
|
|
52
|
+
if [[ "$hs" -eq 0 ]] && ek_pid_alive "${holder%% *}"; then
|
|
53
|
+
lock_refuse "a producer is already running for run key '${holder#* }' (pid ${holder%% *}) — refusing to start; wait for that run to finish, or delete $EVIDENCE_KIT_LOCK_FILE once pid ${holder%% *} is gone"
|
|
54
|
+
fi
|
|
55
|
+
# spec: evidence-kit/SPEC.md §The producer-liveness lock — a dead or vanished holder is reclaimed exactly once; a second failed claim means the slot is not ours to take, so refusing beats looping
|
|
56
|
+
[[ "$reclaimed" -eq 0 ]] \
|
|
57
|
+
|| lock_refuse "could not claim $EVIDENCE_KIT_LOCK_FILE after reclaiming a stale lock — refusing to start rather than retrying; another producer won the reclaim race, or that path is not writable"
|
|
58
|
+
reclaimed=1
|
|
59
|
+
rm -f "$EVIDENCE_KIT_LOCK_FILE"
|
|
60
|
+
done
|
|
61
|
+
rm -f "$lock_tmp"
|
|
62
|
+
trap lock_release EXIT
|
|
63
|
+
|
|
64
|
+
# spec: evidence-kit/SPEC.md §Evidence manifest — the run accumulates its rows here and touches the tracked manifest only after the last suite, so no suite runs against a tree the spine has already written to
|
|
65
|
+
batch="$(mktemp "$EVIDENCE_KIT_TMP_DIR/validate-evidence-batch.XXXXXX")" || exit 2
|
|
66
|
+
|
|
29
67
|
for suite in "${EVIDENCE_KIT_SUITES[@]}"; do
|
|
30
68
|
cmd="$(ek_suite_cmd "$suite")"
|
|
31
69
|
if [[ -z "$cmd" ]]; then
|
|
@@ -67,16 +105,20 @@ for suite in "${EVIDENCE_KIT_SUITES[@]}"; do
|
|
|
67
105
|
|
|
68
106
|
hash="$(sha256sum "$log" | awk '{print $1}')"; hs=$?
|
|
69
107
|
fail_closed "$hs" run-validate sha256sum
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
# spec: evidence-kit/SPEC.md §Evidence manifest — a re-run supersedes this iteration's prior line for the suite, then appends
|
|
73
|
-
tmpm="$EVIDENCE_KIT_TMP_DIR/validate-evidence.$$"
|
|
74
|
-
awk -v k="$key" -v s="$suite" '!($1 == k && $2 == s)' "$manifest" >"$tmpm"; as=$?
|
|
75
|
-
fail_closed "$as" run-validate awk
|
|
76
|
-
printf '%s\n' "$line" >>"$tmpm"
|
|
77
|
-
mv "$tmpm" "$manifest"
|
|
108
|
+
printf '%s\n' "$key $suite sha256=$hash pass=$npass fail=$nfail ignore=$nignore verdict=$verdict $today" >>"$batch"
|
|
78
109
|
|
|
79
110
|
echo "run-validate: $suite -> $verdict (pass=$npass fail=$nfail ignore=$nignore)"
|
|
80
111
|
done
|
|
81
112
|
|
|
113
|
+
# spec: evidence-kit/SPEC.md §Evidence manifest — one fold, after the last suite: this iteration's prior line for every suite the run covered is superseded and the batch re-appended in roster order, so a repeated run leaves the line order unchanged
|
|
114
|
+
tmpm="$EVIDENCE_KIT_TMP_DIR/validate-evidence.$$"
|
|
115
|
+
awk -v k="$key" -v bf="$batch" '
|
|
116
|
+
FILENAME == bf { superseded[$2] = 1; next }
|
|
117
|
+
!($1 == k && ($2 in superseded))
|
|
118
|
+
' "$batch" "$manifest" >"$tmpm"; as=$?
|
|
119
|
+
fail_closed "$as" run-validate awk
|
|
120
|
+
cat "$batch" >>"$tmpm"
|
|
121
|
+
mv "$tmpm" "$manifest"
|
|
122
|
+
rm -f "$batch"
|
|
123
|
+
|
|
82
124
|
exit "$overall"
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# graph: couples=README.md,scripts/evidence-config.sh,gate-sdk/lib/gate.sh dir=bi valve=none tier=precommit
|
|
3
|
+
# spec: evidence-kit/SPEC.md §check-battery-roster — the runner doc's battery-roster block holds name-set parity with EVIDENCE_KIT_SUITES, both directions
|
|
4
|
+
#
|
|
5
|
+
# usage: check-battery-roster.sh [runner-doc]
|
|
6
|
+
# bare: EVIDENCE_KIT_RUNNER_DOC (default README.md) against the git toplevel;
|
|
7
|
+
# positional: taken as given, so a fixture tree can be pointed at.
|
|
8
|
+
set -uo pipefail
|
|
9
|
+
|
|
10
|
+
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
+
# shellcheck source=../lib/evidence.sh
|
|
12
|
+
source "$KIT/lib/evidence.sh"
|
|
13
|
+
|
|
14
|
+
BEGIN="<!-- battery-roster:begin -->"
|
|
15
|
+
END="<!-- battery-roster:end -->"
|
|
16
|
+
|
|
17
|
+
DOC="${1:-}"
|
|
18
|
+
if [[ -z "$DOC" ]]; then
|
|
19
|
+
top="$(git rev-parse --show-toplevel)" \
|
|
20
|
+
|| { echo "check-battery-roster: not a git repository and no runner-doc argument" >&2; exit 2; }
|
|
21
|
+
DOC="$top/${EVIDENCE_KIT_RUNNER_DOC:-README.md}"
|
|
22
|
+
fi
|
|
23
|
+
[[ -f "$DOC" ]] || { echo "check-battery-roster: runner doc not found: $DOC" >&2; exit 2; }
|
|
24
|
+
[[ ${#EVIDENCE_KIT_SUITES[@]} -gt 0 ]] \
|
|
25
|
+
|| { echo "check-battery-roster: EVIDENCE_KIT_SUITES is empty — no suite roster to hold $DOC against" >&2; exit 2; }
|
|
26
|
+
grep -qF -- "$BEGIN" "$DOC" \
|
|
27
|
+
|| { echo "check-battery-roster: no '$BEGIN' marker block in $DOC" >&2; exit 2; }
|
|
28
|
+
|
|
29
|
+
# spec: evidence-kit/SPEC.md §check-battery-roster — a suite's documented invocation is EVIDENCE_KIT_RUN_<suite> minus a leading 'env' and its VAR=value assignments, the validate harness's environment being no part of what a contributor types
|
|
30
|
+
normalize_invocation() {
|
|
31
|
+
local -a t=()
|
|
32
|
+
read -r -a t <<<"${1-}"
|
|
33
|
+
local out="" tok head=1
|
|
34
|
+
for tok in ${t[@]+"${t[@]}"}; do
|
|
35
|
+
if [[ "$head" -eq 1 ]]; then
|
|
36
|
+
[[ "$tok" == "env" || "$tok" =~ ^[A-Za-z_][A-Za-z0-9_]*= ]] && continue
|
|
37
|
+
head=0
|
|
38
|
+
fi
|
|
39
|
+
out+="${out:+ }$tok"
|
|
40
|
+
done
|
|
41
|
+
printf '%s\n' "$out"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
roster="$(awk -v b="$BEGIN" -v e="$END" '
|
|
45
|
+
{ line = $0; sub(/#.*$/, "", line); gsub(/^[ \t]+|[ \t\r]+$/, "", line); gsub(/[ \t]+/, " ", line) }
|
|
46
|
+
line == b { inb = 1; next }
|
|
47
|
+
line == e { inb = 0; next }
|
|
48
|
+
inb && line ~ /^[a-z][a-z0-9_-]* / { print FNR ":" line }
|
|
49
|
+
' "$DOC")"; st=$?
|
|
50
|
+
fail_closed "$st" check-battery-roster awk
|
|
51
|
+
|
|
52
|
+
declare -A roster_line=()
|
|
53
|
+
while IFS= read -r r; do
|
|
54
|
+
[[ -n "$r" ]] || continue
|
|
55
|
+
roster_line["${r#*:}"]="${r%%:*}"
|
|
56
|
+
done <<<"$roster"
|
|
57
|
+
|
|
58
|
+
declare -A suite_of=()
|
|
59
|
+
for s in "${EVIDENCE_KIT_SUITES[@]}"; do
|
|
60
|
+
c="$(normalize_invocation "$(ek_suite_cmd "$s")")"
|
|
61
|
+
[[ -n "$c" ]] && suite_of["$c"]="$s"
|
|
62
|
+
done
|
|
63
|
+
|
|
64
|
+
findings=()
|
|
65
|
+
# assertion A: every configured suite's documented invocation is a roster line
|
|
66
|
+
for c in "${!suite_of[@]}"; do
|
|
67
|
+
[[ -n "${roster_line[$c]:-}" ]] \
|
|
68
|
+
|| findings+=("$DOC: suite '${suite_of[$c]}' is absent from the battery-roster block — no line reads '$c'")
|
|
69
|
+
done
|
|
70
|
+
# assertion B: every roster line resolves to a configured suite
|
|
71
|
+
for c in "${!roster_line[@]}"; do
|
|
72
|
+
[[ -n "${suite_of[$c]:-}" ]] \
|
|
73
|
+
|| findings+=("$DOC:${roster_line[$c]}: roster line runs no configured suite: '$c'")
|
|
74
|
+
done
|
|
75
|
+
|
|
76
|
+
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
77
|
+
printf '%s\n' "check-battery-roster: the battery-roster block is out of parity with EVIDENCE_KIT_SUITES:"
|
|
78
|
+
printf ' %s\n' "${findings[@]}" | sort
|
|
79
|
+
echo " help: keep the block in name-set parity with the configured suites — add the"
|
|
80
|
+
echo " missing suite's documented invocation, or drop the line whose command"
|
|
81
|
+
echo " runs no configured suite (evidence-kit/SPEC.md §check-battery-roster)."
|
|
82
|
+
exit 1
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
echo "BATTERY-ROSTER: clean (${#EVIDENCE_KIT_SUITES[@]} configured suite(s) in name-set parity with the battery-roster block in $DOC)"
|
|
86
|
+
exit 0
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# graph: couples=.tmp/run-validate.lock dir=one valve=none tier=align-only
|
|
3
|
+
# spec: evidence-kit/SPEC.md §check-producer-liveness — a stage entry is refused while the evidence producer's lock names a live PID
|
|
4
|
+
set -uo pipefail
|
|
5
|
+
|
|
6
|
+
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
7
|
+
# shellcheck source=../lib/evidence.sh
|
|
8
|
+
source "$KIT/lib/evidence.sh"
|
|
9
|
+
|
|
10
|
+
LOCK="${1:-$EVIDENCE_KIT_LOCK_FILE}"
|
|
11
|
+
|
|
12
|
+
holder="$(ek_lock_read "$LOCK")"; hs=$?
|
|
13
|
+
|
|
14
|
+
if [[ "$hs" -eq 2 ]]; then
|
|
15
|
+
echo "check-producer-liveness: $LOCK carries no readable 'pid=<n> run=<key>' record" >&2 # exit 2: the lock is published whole or not at all, so an unparseable one is corruption, never a free reading
|
|
16
|
+
exit 2
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
if [[ "$hs" -ne 0 ]]; then
|
|
20
|
+
echo "PRODUCER-LIVENESS: clean (no producer lock at $LOCK — nothing in flight)"
|
|
21
|
+
exit 0
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
pid="${holder%% *}"
|
|
25
|
+
runkey="${holder#* }"
|
|
26
|
+
|
|
27
|
+
if ek_pid_alive "$pid"; then
|
|
28
|
+
echo "check-producer-liveness: $LOCK: the evidence producer for run key '$runkey' is still running (pid $pid)"
|
|
29
|
+
echo " help: wait for that run-validate to finish — it is still writing the evidence manifest, so anything read now can change underneath you; if pid $pid is gone, the lock is stale and deleting $LOCK clears it"
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
echo "PRODUCER-LIVENESS: clean (lock at $LOCK names dead pid $pid for run key '$runkey' — no producer in flight)"
|
|
34
|
+
exit 0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
runner.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
suite 'beta' is absent from the battery-roster block
|