PYR0D-401: Validation intent: stop workers passing --intent through a shared temp file #46

Merged
john merged 6 commits from fm/fm-nm-intent-file-fix into main 2026-10-19 04:38:30 +00:00
Owner

Story: PYR0D-401 - Validation intent: stop workers passing --intent through a shared temp file
Author: airouter-ch/Qwen3.8 via omp

What was wrong. Investigation fm-nm-wrong-intent (report: /home/john/code/firstmate/data/fm-nm-wrong-intent/report.md) traced a forms validation run (FORMS-31) that was validated against Flow PR 153's intent: workers wrote their intent to the host-global /tmp/nm-intent.txt and ran with --intent "$(cat /tmp/nm-intent.txt)"; when one task's write was rejected by the harness, the file still held another task's text, and the run used it. The no-mistakes daemon stored and used exactly what it was given; the defect is the worker-side transport, not the tool.

What changed. The no-mistakes driving contract in bin/fm-dod-lib.sh now:

  • carries the intent inline, or through a file named by absolute path inside the task's own data directory (fm_dod_block takes an optional data-dir argument; fm-brief.sh and fm-promote.sh pass it, so normal and promoted briefs agree). No PID suffix, because each agent shell call gets a new PID and a later cat would silently read nothing;
  • requires the write and the read-back to happen in one step, with the read-back matching the exact --intent string composed under the existing rules before no-mistakes axi run fires;
  • repeats the same rule in fm_brief_intent_overlay, the contract fm-spawn.sh re-renders at every spawn and relaunch, so relaunched and legacy-briefed tasks get the transport rule too;
  • removes the file once the run has started.

The transport text lives in one helper (fm_nm_intent_transport_block) shared by the driving block and the overlay; the one-owner rule is preserved.

Follow-up (out of scope here). Defence-in-depth for the no-mistakes tool itself: no-mistakes axi run --intent could warn when the supplied intent names a different repo/branch/PR than the run's own repo+branch. The report's section 6 records the rationale; file with no-mistakes as hardening.

Verification. tests/fm-brief.test.sh (new regression asserts the concrete file name, the one-step read-back, the composed-string target, and the cleanup line), tests/fm-dod-lib.test.sh, tests/fm-task-delivery.test.sh all pass; shellcheck clean; the regression was proven to fail against the pre-fix lib and against a mutation dropping the read-back sentence.

**Story:** PYR0D-401 - Validation intent: stop workers passing --intent through a shared temp file **Author:** airouter-ch/Qwen3.8 via omp **What was wrong.** Investigation fm-nm-wrong-intent (report: /home/john/code/firstmate/data/fm-nm-wrong-intent/report.md) traced a forms validation run (FORMS-31) that was validated against Flow PR 153's intent: workers wrote their intent to the host-global /tmp/nm-intent.txt and ran with --intent "$(cat /tmp/nm-intent.txt)"; when one task's write was rejected by the harness, the file still held another task's text, and the run used it. The no-mistakes daemon stored and used exactly what it was given; the defect is the worker-side transport, not the tool. **What changed.** The no-mistakes driving contract in bin/fm-dod-lib.sh now: - carries the intent inline, or through a file named by absolute path inside the task's own data directory (fm_dod_block takes an optional data-dir argument; fm-brief.sh and fm-promote.sh pass it, so normal and promoted briefs agree). No $$ PID suffix, because each agent shell call gets a new PID and a later cat would silently read nothing; - requires the write and the read-back to happen in one step, with the read-back matching the exact --intent string composed under the existing rules before no-mistakes axi run fires; - repeats the same rule in fm_brief_intent_overlay, the contract fm-spawn.sh re-renders at every spawn and relaunch, so relaunched and legacy-briefed tasks get the transport rule too; - removes the file once the run has started. The transport text lives in one helper (fm_nm_intent_transport_block) shared by the driving block and the overlay; the one-owner rule is preserved. **Follow-up (out of scope here).** Defence-in-depth for the no-mistakes tool itself: no-mistakes axi run --intent could warn when the supplied intent names a different repo/branch/PR than the run's own repo+branch. The report's section 6 records the rationale; file with no-mistakes as hardening. **Verification.** tests/fm-brief.test.sh (new regression asserts the concrete file name, the one-step read-back, the composed-string target, and the cleanup line), tests/fm-dod-lib.test.sh, tests/fm-task-delivery.test.sh all pass; shellcheck clean; the regression was proven to fail against the pre-fix lib and against a mutation dropping the read-back sentence.
Workers have catted a host-global /tmp/nm-intent.txt into --intent; when a
write was rejected, a later run read another task's intent out of that file
(2026-10-13 forms-vs-flow incident, PYR0D-401). The driving contract now
pins the transport to a file unique to this task inside this task's own
data directory, requires a read-back against the brief's intent before the
run fires, and names the incident as the reason. tests/fm-brief.test.sh
regression fails on both the pre-fix lib and a verify-step drop.
no-mistakes(document): Point intent-transport comment at its regression test
Some checks failed
CI / Behavior portable serial 5 (pull_request) Failing after 30m0s
CI / Test coverage guard (pull_request) Successful in 39s
CI / Behavior portable parallel 1 (pull_request) Successful in 22m41s
CI / Lint 2 (pull_request) Successful in 23m25s
CI / Lint 1 (pull_request) Successful in 27m11s
CI / Behavior portable parallel 2 (pull_request) Successful in 18m9s
CI / Behavior portable serial 2 (pull_request) Successful in 21m7s
CI / Behavior portable serial 1 (pull_request) Successful in 24m5s
CI / Behavior portable serial 3 (pull_request) Successful in 22m46s
CI / Behavior portable serial 7 (pull_request) Successful in 20m29s
CI / Behavior portable serial 8 (pull_request) Successful in 20m57s
CI / Repo invariants (pull_request) Successful in 8s
CI / Behavior tests (Herdr) (pull_request) Successful in 16m10s
CI / Behavior portable serial 4 (pull_request) Failing after 16m48s
CI / Behavior portable serial 6 (pull_request) Successful in 20m48s
CI / Behavior portable serial 9 (pull_request) Successful in 29m19s
2645dd0974
Merge remote-tracking branch 'origin/main' into fm/fm-nm-intent-file-fix
Some checks failed
CI / Test coverage guard (pull_request) Successful in 42s
CI / Lint 1 (pull_request) Successful in 20m44s
CI / Behavior portable parallel 1 (pull_request) Successful in 22m9s
CI / Lint 2 (pull_request) Successful in 29m47s
CI / Behavior portable parallel 2 (pull_request) Successful in 18m15s
CI / Behavior portable serial 1 (pull_request) Successful in 23m13s
CI / Behavior portable serial 6 (pull_request) Has been cancelled
CI / Behavior portable serial 7 (pull_request) Has been cancelled
CI / Behavior portable serial 8 (pull_request) Has been cancelled
CI / Behavior portable serial 9 (pull_request) Has been cancelled
CI / Behavior tests (Herdr) (pull_request) Has been cancelled
CI / Behavior portable serial 4 (pull_request) Has been cancelled
CI / Repo invariants (pull_request) Has been cancelled
CI / Behavior portable serial 5 (pull_request) Has been cancelled
CI / Behavior portable serial 2 (pull_request) Has been cancelled
CI / Behavior portable serial 3 (pull_request) Has been cancelled
1c812aefe9
ci: re-trigger after 2026-10-15 hosted-runner cancellation
Some checks failed
CI / Test coverage guard (pull_request) Successful in 34s
CI / Behavior portable parallel 2 (pull_request) Successful in 16m52s
CI / Behavior portable parallel 1 (pull_request) Successful in 21m7s
CI / Lint 1 (pull_request) Successful in 21m12s
CI / Lint 2 (pull_request) Failing after 30m0s
CI / Behavior portable serial 1 (pull_request) Successful in 23m0s
CI / Behavior portable serial 2 (pull_request) Successful in 22m57s
CI / Behavior portable serial 3 (pull_request) Successful in 23m35s
CI / Behavior portable serial 4 (pull_request) Successful in 23m3s
CI / Behavior portable serial 5 (pull_request) Successful in 23m48s
CI / Behavior portable serial 7 (pull_request) Failing after 19m42s
CI / Behavior portable serial 6 (pull_request) Successful in 23m39s
CI / Repo invariants (pull_request) Successful in 8s
CI / Behavior portable serial 8 (pull_request) Successful in 23m47s
CI / Behavior tests (Herdr) (pull_request) Successful in 16m6s
CI / Behavior portable serial 9 (pull_request) Successful in 24m25s
8751e3f2bd
john merged commit 885069dad7 into main 2026-10-19 04:38:30 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
john/firstmate!46
No description provided.