PR #1309 — Fleet Parity: Instruction File Preflight Check and Closed-Loop Receipt Verification
PR #1309 — Fleet Parity: Instruction File Preflight Check and Closed-Loop Receipt Verification
The Broader Goal at the End of the Previous PR
PR #1308 closed issue #342 by enforcing --cwd for Grok and -C for Codex, securing working-directory root containment across all autonomous dispatches. That left issue #347 as the final remaining open ticket from the original dogfooding-readiness fleet-parity cluster.
What Was Missing
Synlynk coordinates multi-agent workflows through instruction files (CLAUDE.md, GEMINI.md, AGENTS.md, GROK.md), where role boundaries, commit trailer requirements, and PR review protocols are defined.
However, the pipeline previously relied on unverified trust:
_preflight_dispatch()did not verify that a Core 4 agent's directive file was actually present and readable in an initialized repo. In issue #343,AGENTS.mdwas missing entirely, yet dispatches executed blindly.- Even when a file exists on disk, there was zero closed-loop verification that the spawned CLI actually read and internalized it. A job could report success while silently violating all repo conventions.
What Shipped
- Instruction Version Extraction:
- Added
extract_instruction_version()andget_instruction_file_for_agent()insynlynk/instructions.py, extracting canonical version tokens from bothsynlynk:startandsynlynk:harnessmarkers.
- Added
- Preflight Gate in
_preflight_dispatch:- Fails closed with
INSTRUCTION_FILE_MISSINGif an instruction file for a Core 4 agent is absent in an initialized repo, unless explicitly bypassed with--force-harness/--force-agent.
- Fails closed with
- Closed-Loop Instruction Receipt Protocol:
- In
synlynk/dispatch.py:_format_prompt_for_agent(), prompts the agent to echoSYNLYNK_INSTRUCTION_VERSION: <version>without revealing the version string in the prompt text. - The agent must genuinely inspect its loaded directive file to return the matching token.
- In
- Log Analysis & Advisory Signals:
- In
synlynk/jobs.py, added_check_instruction_receipt()to classify output asok,mismatch,none, orabsent. - Wired into
_reconcile_jobs()and_reconcile_active_job()to record telemetry and emit advisory sentinel alerts on convention drift.
- In
- Comprehensive TDD Tests:
- Added unit tests in
tests/test_instructions.py,tests/test_dispatch.py, andtests/test_jobs.py. - All 499 tests in
tests/test_synlynk.pypass cleanly.
- Added unit tests in