Skip to content

Remove the dead prompt-synthesis path, and stop calling two corpora mirrors - #304

Merged
piyushmakhija28 merged 1 commit into
mainfrom
fix/dead-prompt-synthesis
Aug 8, 2026
Merged

piyushmakhija28 merged 1 commit into
mainfrom
fix/dead-prompt-synthesis

Conversation

@piyushmakhija28

Copy link
Copy Markdown
Collaborator

Both found by reading the live run's log, not the code.

1. A function that has been dead for three months, and lied about it

synthesize_prompt_with_flow_data loaded a PromptGenerator by dynamic import from:

scripts/architecture/03-execution-system/00-prompt-generation/prompt-generation-policy.py

That file was deleted on 2026-05-04 in 683c23a. The import is the function's first statement, so it has raised on every run since, and the ninety lines of flow-data assembly after it were unreachable the whole time. Removed rather than left reading as live code — 97 lines out, 31 in.

The except-branch was not a fallback, it was a false report. It returned state[USER_MESSAGE] under the key synthesized_prompt, and flow_trace_converter writes that key to current-synthesis.txt and prints:

Synthesis: Generated (N chars)

So for three months the trace claimed a synthesis had been produced while writing out the raw task, unchanged. Returning empty lets the consumer's own if synthesized_prompt: guard skip the file — nothing was synthesised, so nothing is reported as synthesised. The metadata names the commit that removed the generator, so the next reader does not have to bisect for it.

The per-run stderr [WARNING] Prompt synthesis failed: goes with it. It announced a permanent condition as though it were an incident, on every run — and it was the only line in an otherwise clean log that looked like something had gone wrong today.

2. docs/policies/ was never a mirror of ~/.claude/policies/

CLAUDE.md claimed it was, and claimed the same for docs/standards/ ↔ ~/.claude/rules/. Measured on 2026-08-08, the policy trees had drifted apart by 25 files:

In the repo, absent from the machine 18
On the machine, in no repository at all 7

Several of the 7 are for 02-plan-mode/ and 05-skill-agent-selection/ — features v1.15.2 purged.

The more useful correction is that they were never meant to match. docs/policies/ is documentation of pipeline behaviour (quality-gate-policy.md, pr-code-review-policy.md) and nothing loads it. ~/.claude/policies/ is the runtime corpus get_policies_dir() reads, of which the standards selector consumes only the 02-standards-system/ tier and the language-mapped files.

"Mirror" invited the assumption that editing one affected the other, which it never did in either direction. The note also records that the 7 machine-only files are unversioned — if that machine is lost, so are they.

Verified on a live run

  • [WARNING] Prompt synthesis failed — gone
  • Synthesis: Generated — gone, and no current-synthesis.txt written
  • Step 1 still emits its 333,165-char prompt
  • 176 tests across every suite touching the orchestrator, synthesis or flow-trace; all six gates

One scare, recorded because it looked like a regression

The run immediately after this change hit the script's 300-second orchestration cap, where earlier runs took 46 s and 53 s. It was not this change: the 167.9-second gap was inside context_sync/session_loader, which this diff does not touch, scanning 684 MB across 47 session directories and 1,099 files accumulated by the day's test runs. A re-run finished in 99 s.

The 300 s cap and the unbounded session history are a real pairing and will bite again — but not in this commit.

🤖 Generated with Claude Code

…ora mirrors

Two things found by reading the live run's log rather than the code.

synthesize_prompt_with_flow_data loaded a PromptGenerator from
scripts/architecture/03-execution-system/00-prompt-generation/prompt-generation-policy.py
by dynamic import. That file was deleted on 2026-05-04 in 683c23a. The import is
the function's first statement, so it has raised on every run since, and the
ninety lines of flow-data assembly after it were unreachable for three months.
They are removed rather than left reading as live code.

The except-branch was not a fallback, it was a false report. It returned
state[USER_MESSAGE] under the key synthesized_prompt, and
flow_trace_converter writes that key to current-synthesis.txt and prints
"Synthesis: Generated (N chars)". So the trace claimed a synthesis had been
produced while writing out the raw task, unchanged. Returning empty lets the
consumer's own `if synthesized_prompt:` guard skip the file, which is the honest
outcome: nothing was synthesised, so nothing is reported as synthesised. The
metadata names the commit that removed the generator, so the next reader does
not have to bisect for it.

The per-run stderr WARNING goes with it. It announced a permanent condition as
though it were an incident, on every single run, and it was the only line in an
otherwise clean log that looked like something had gone wrong today.

CLAUDE.md called docs/policies/ a mirror of ~/.claude/policies/ and
docs/standards/ a mirror of ~/.claude/rules/. Neither is true. The policy trees
had drifted apart by 25 files: 18 names in the repository are absent from the
machine, and 7 on the machine are in no repository at all -- several of them for
plan-mode and skill-agent-selection, which v1.15.2 purged.

They were never meant to match, which is the more useful correction.
docs/policies/ is documentation of pipeline behaviour and nothing loads it;
~/.claude/policies/ is the runtime corpus get_policies_dir() reads, of which the
standards selector consumes only the 02-standards-system/ tier and the
language-mapped files. "Mirror" invited the assumption that editing one affected
the other, which it never did in either direction. The note also records that
the 7 machine-only files are unversioned.

Verified on a live run: the WARNING is gone, no current-synthesis.txt is written,
"Synthesis: Generated" no longer appears, and Step 1 still emits its 333,165-char
prompt. 176 tests across every suite touching the orchestrator, synthesis or
flow-trace, plus all six gates.

One scare worth recording: the run immediately after this change hit the script's
300-second orchestration cap where earlier runs took 46 and 53 seconds. It was
not this change. The 167.9-second gap was inside context_sync/session_loader,
which this diff does not touch, scanning 684 MB across 47 session directories and
1,099 files accumulated by the day's test runs. A re-run finished in 99 seconds.
The cap and the unbounded session history are a real pairing and will bite again,
but they are not this commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@piyushmakhija28
piyushmakhija28 merged commit dcc222f into main Aug 8, 2026
6 checks passed
@piyushmakhija28
piyushmakhija28 deleted the fix/dead-prompt-synthesis branch August 8, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant