Populate prawduct ai-content prompts (open-queue #2 post-#139)#200
Merged
Conversation
Replaces the three placeholder prompts in data/templates/prawduct/template.json that surfaced as `skipped` rows in every V2 wrap drawer post-Chunk-11c. Real prompts now instruct the AI to: - changelog-update: edit CHANGELOG.md [Unreleased] per Keep-a-Changelog style with a `## Result` tail acknowledgment. - learnings-capture: append non-obvious takeaways to .tangleclaw/memories/learnings.md (or write `no novel learnings` rather than fabricating signal). - memory-update: write a new `Last Session` block to MEMORY.md (demoting the prior block to wrap-log.md) and emit `## Summary` + `## NextSteps` + `## Learnings` heading blocks. `_parseFields` in lib/wrap-steps/ai-content.js parses these against the step's captureFields and `_completeV2Wrap`'s summary deriver consumes `## Summary` for the wrap commit subject. ADR 0002 Status line extended with the prompt-population marker. CHANGELOG.md [Unreleased] under `### Changed` gains an entry plus the migration note for existing prawduct projects (_reconcileMergeBy:id is additive-only per ADR 0001 — they keep empty prompts on reconcile until a future per-field reconciler chunk). Tests: new test/prawduct-aicontent-prompts.test.js pins prompt invariants (>=200 chars each, `## Summary` / `## NextSteps` / `## Learnings` instructions in memory-update, captureFields lockstep) and the minimal-methodology empty-prompt anchor (Chunk 11c contract still exercised by a bundled methodology). Full suite: 2281/2281 pass (+5 from new structural pins).
m1 (MINOR — load-bearing): CHANGELOG migration recipe pointed at the per-project `.tangleclaw/project.json` instead of the methodology template cache `~/.tangleclaw/templates/prawduct/template.json`. Deleting the per-project config does not refresh the cached template; `_copyBundledTemplates` only re-copies from `data/templates/` when the cached directory is missing. Corrected the migration paragraph to spell out the cache location, the stop-server prerequisite, and the copy-on-empty contract. n2 (NIT): `learnings-capture` prompt referenced `Chunk 9` by name in its step-5 instruction. Internal #139 sequence numbering leaks no meaning to a future runtime AI. Removed the parenthetical; sentence is unchanged in content. n5 (NIT): ADR 0002 Status-line extension marker for this chunk was inserted out of chronological order (was: 2026-05-14 ... 2026-05-21 ... 2026-05-15 ... 2026-05-18). Restored to chronological order at the end of the chain (after Chunk 10). Coverage gaps (4 new pins in test/prawduct-aicontent-prompts.test.js): - Lockstep: every captureField on memory-update appears as a `## Heading` literal in the prompt. Catches a future PR that adds `risks` to captureFields without adding `## Risks` to the prompt (would silently block every wrap). - Inverse drift: every `## Heading` in the prompt (other than the free-form `## Result` tail) corresponds to a captureField. Catches the symmetric case — a `## Risks` block instructed but never declared to the parser. - No `{...}` interpolation tokens: pins the build-plan's explicit out-of-scope decision (no new tokens). Prevents accidental introduction of `{recentCommits}` etc. that `_interpolatePrompt` would pass through verbatim. - `_reconcileMergeBy` additive-only behavior pin: simulates an existing on-disk template with empty prompts, calls `store._reconcileMergeBy`, asserts `null` (no change). Grounds the CHANGELOG migration note's behavioral claim with a unit test. Full suite: 2285 / 2285 pass (+9 from this chunk total).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the three placeholder prompts in
data/templates/prawduct/template.jsonwith real content. The three steps (changelog-update,learnings-capture,memory-update) shipped with emptyprompt: ""strings post-Chunk-11c and surfaced asskippedrows in every V2 wrap drawer — functional, but produced no user-visible session output.Why
Highest-leverage open-queue item per MEMORY.md boot pointer: gives V2 prawduct wraps actual CHANGELOG entries, learnings-capture, and memory-update output instead of three
SKIPPEDrows. The plumbing has been in place since Chunk 5 (realai-contenthandler with send/poll/capture/validate); only the prompts were missing.Validated end-to-end this morning via the V2 smoke test on
prawduct-test(commits1841083+9e1d79e3) — confirmed the threeSKIPPEDrows render correctly but produce no useful output. That gap closes here.How
Prompt design principles:
git log,git diff, read CHANGELOG.md / MEMORY.md / learnings.md itself, rather than depending on TC-side prompt-interpolation expansion. Matches the ADR 0002 hybrid contract ("TC owns workflow; AI owns content"). Keeps the Chunk 5 interpolation surface unchanged (only{previousMemoryBlock}is recognized; this PR pins no-new-tokens via a test).memory-updateis the structured one.captureFields: ["summary", "nextSteps", "learnings"]requires the AI to emit three## Headingblocks (case-insensitive match per_parseFields). Prompt explicitly names each heading + explains WHY (so future methodology authors don't strip the structured-response section as verbose).## Resulttail discipline.changelog-updateandlearnings-capturehave nocaptureFields, so the handler's ≥20-char threshold is the only validation. The## Resultheading convention gives the wrap commit body something stable to summarize and prevents AI no-ops from accidentally passing the threshold with chatter.Migration note for existing prawduct projects
The methodology template is cached at
~/.tangleclaw/templates/prawduct/template.json(via_copyBundledTemplatesatlib/store.json TC server boot)._reconcileMergeBy:id(ADR 0001) is additive-only on existing step ids, so cached templates withprompt: ""keep their empty prompts on every subsequent boot.To pick up the populated prompts on an existing install:
~/.tangleclaw/templates/prawduct/template.json(or the full~/.tangleclaw/templates/prawduct/directory)._copyBundledTemplatesre-copies fromdata/templates/prawduct/template.jsononly when the cached dir is missing.The per-project
.tangleclaw/project.jsonis the per-project config, not the methodology template cache — deleting it does not refresh the bundled prompts. (Earlier draft of this PR pointed at the wrong file; Critic m1 caught it pre-merge.)Alternative: wait for a future chunk that introduces per-field reconciliation of
step.prompt. Tracked in.claude/plans/prawduct-aicontent-prompts.mdChunk 1 "Out of scope".Test plan
9 new tests in
test/prawduct-aicontent-prompts.test.js:changelog-updateprompt ≥200 chars, references CHANGELOG.md /[Unreleased]/## Result.learnings-captureprompt ≥200 chars, references learnings.md /## Result.memory-updateprompt ≥200 chars, mentions## Summary/## NextSteps/## Learnings;captureFieldslockstep.## Resulttail discipline.## <Field>literal in the prompt.## <Heading>in the prompt (other than## Result) corresponds to a captureField.{...}interpolation tokens (post-Critic): pins the no-new-tokens decision._reconcileMergeByadditive-only behavior pin (post-Critic): unit test that grounds the migration note's claim.Full suite: 2285 / 2285 pass on this branch (was 2276 on
mainpost-Fix tmux.createSession env vars not reaching launch command process #191; net +9).Independent Critic review: YELLOW → GREEN. 1 MINOR (m1: migration recipe) + 5 NITs + 4 coverage gaps. m1 + n2 (Chunk-9 leak) + n5 (ADR Status-line chronology) + all 4 coverage-gap pins addressed in fixup commit
209ccfb. n1 (_parseFieldswhitespace fragility) filed as follow-up enhancement (out of scope per build plan — no handler code changes). n3 (cross-step## Resultheading is currently safe per Critic's own assessment), n4 (em-dash diff noise, cosmetic) declined.Files touched
data/templates/prawduct/template.json— three ai-content step prompts populateddocs/adr/0002-wrap-pipeline-contract.md— Status line extension marker (post-Critic: chronologically ordered)CHANGELOG.md—[Unreleased]### Changedentry with corrected migration notetest/prawduct-aicontent-prompts.test.js— new (9 tests, 3 describe blocks)Out of scope
{recentCommits},{filesChanged},{lastWrapSha}). Tracked in.claude/plans/prawduct-aicontent-prompts.mdChunk 1 "Out of scope".step.promptfor existing projects. Same._parseFieldswhitespace tolerance on heading names (Critic n1 — file as follow-up enhancement).