Skip to content

chore(memory): record #394 lessons and compact the orchestrator memory index - #534

Merged
drmoisan merged 1 commit into
epic/build-ci-coverage-gate-fidelity-integrationfrom
chore/orchestrator-memory-394
Aug 11, 2026
Merged

chore(memory): record #394 lessons and compact the orchestrator memory index#534
drmoisan merged 1 commit into
epic/build-ci-coverage-gate-fidelity-integrationfrom
chore/orchestrator-memory-394

Conversation

@drmoisan

Copy link
Copy Markdown
Owner

chore(memory): record #394 lessons and compact the orchestrator memory index

Summary

  • Adds one new orchestrator memory: never commit a helper script under a feature's evidence/ tree.
  • Updates the pr_context.summary.txt memory with a newly observed stale-content failure mode.
  • Compacts MEMORY.md from 19.6KB to 13.9KB. All 77 entries preserved; none dropped or merged.
  • Touches only .claude/agent-memory/orchestrator/**. No production code, no policy files, no rules.

Why

Follow-up to #394 (merged as PR #533). Two findings from that run are worth persisting, and the SessionStart hook flagged the orchestrator memory index as approaching its 24.4KB read limit.

Finding 1 — helper scripts under evidence/. feature-review's Get-ChangedLanguageSet matches on file extension alone and is completely path-blind. A 27-line duplicate-sweep.ps1 that the executor retained under <FEATURE>/evidence/baseline/ "for reproducibility" therefore put PowerShell into the branch's changed-language set, which triggered the mandatory coverage-verification rule with no Pester test and no coverage artifact behind it. That cost a full remediation cycle (planner, executor, reaudit) on a branch whose only real change was deleting one line from a .csproj. The plan had only ever required capturing the script's output.

Finding 2 — stale PR context. collect_pr_context returned ok:true and listed the worktree artifact paths, but did not overwrite an existing hand-authored pr_context.summary.txt. The stale file still described the .ps1 that remediation had already deleted, so authoring a PR body from it would have described the wrong diff.

What Changed

  • New feedback_no_helper_scripts_under_evidence.md — the rule, why it fires, and the proportionate remediation (git rm the script; the sibling .md artifact already carries its logic and output verbatim).
  • Updated pr-context-summary-unreliable-gh-and-classification.md — adds the stale-content variant alongside the existing "gh unavailable" and misclassification variants.
  • Compacted MEMORY.md — one line per entry with shortened hooks. Detail already lives in the topic files the index points at.

Verification

  • Entry count before and after: 77. Verified with grep -c "^- \[".
  • Size: 19.6KB → 13.9KB, under the 17.1KB target the hook asked for.
  • Every index link target still exists as a file in .claude/agent-memory/orchestrator/.

Not verified in this PR: no build or test gate applies. The diff contains zero source files.

Backward Compatibility / Migration Notes

None. Memory files are agent-facing documentation.

Risks and Mitigations

The compaction rewrites every line of MEMORY.md, so a concurrently in-flight epic sibling that appends its own index line will conflict on this file rather than merging cleanly. This is the known .claude/agent-memory/** fan-in conflict, and the resolution is unchanged: take both sides' entries. To keep that window as small as possible this PR is deliberately tiny and is being merged immediately after creation. A resolver should keep the compacted form and re-append the sibling's line rather than restoring the long-hook version.

Review Guide

Read feedback_no_helper_scripts_under_evidence.md first; the MEMORY.md diff is mechanical hook-shortening.

Follow-ups

None.

GitHub Auto-close

None.

New memory: helper scripts must never be committed under a feature's evidence/
tree. feature-review's Get-ChangedLanguageSet matches on file extension alone
and is path-blind, so a single 27-line duplicate-sweep.ps1 retained under
evidence/baseline/ put PowerShell into the branch's changed-language set,
triggered the mandatory coverage rule with no Pester test behind it, and cost a
full remediation cycle on a branch whose only real change was deleting one line
from a .csproj.

Updated the pr_context memory with a stale-content variant: collect_pr_context
returned ok:true and listed the worktree artifact paths but did not overwrite an
existing hand-authored pr_context.summary.txt, leaving a summary that described
a file the remediation cycle had already deleted. Check the summary's head and
merge-base SHAs against git before authoring from it.

Compacted MEMORY.md from 19.6KB to 13.9KB (the SessionStart hook flagged it as
approaching the 24.4KB read limit). All 77 entries are preserved one-per-line
with shortened hooks; no entry was dropped or merged, and no topic file lost
content. Detail already lives in the topic files the index points at.

Refs #394

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@drmoisan
drmoisan merged commit 5604121 into epic/build-ci-coverage-gate-fidelity-integration Aug 11, 2026
@drmoisan
drmoisan deleted the chore/orchestrator-memory-394 branch August 15, 2026 02:51
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