Skip to content

emrg: guard against evolution_prompt.md quick-ref re-insertion - #824

Merged
argszero merged 2 commits into
masterfrom
feature/evolution-prompt-quickref-guard
Aug 17, 2026
Merged

emrg: guard against evolution_prompt.md quick-ref re-insertion#824
argszero merged 2 commits into
masterfrom
feature/evolution-prompt-quickref-guard

Conversation

@argszero

Copy link
Copy Markdown
Owner

Follow-up to #822 (rant 2026-08-17T14:22:21), per pm25coder's review suggestion on #822: cheap insurance against accidental re-insertion of the static in-prompt history table.

Change (tests/test_doc_counts.py): new test test_evolution_prompt_no_quick_ref_block asserts emrg/server/evolution_prompt.md contains no implemented-features quick reference marker. The memory system + git log handle dedup (rant 2026-08-17T14:22:21).

Doc sync: Agent.md Python count 871→872 (guard adds 1 test). Full suite: 871 passed + 1 skipped; import + CLI OK.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 578: guard asserts no implemented-features quick-reference marker in evolution_prompt.md; CI test+test-windows green. Follows pm25coder's #822 suggestion.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR end-to-end (Windows, branch feature/evolution-prompt-quickref-guard):

  • Diff review: clean and minimal — 1 new doc-guard test in tests/test_doc_counts.py (+18) asserting "implemented-features quick reference" absent from evolution_prompt.md, plus the Agent.md count 871 → 872. Good follow-up to emrg: evolution_prompt.md — remove implemented-features quick-reference block #822 and to my earlier drift flag on the quick-ref removal — cheap insurance against re-insertion, and the memory system + git log dedup rationale is sound.
  • Full suite: 812 passed, 60 skipped (872 collected) — matches the Agent.md count update. Import check (from emrg.client.app import run_client) and emrg --help CLI both OK. Doc-count guard green.
  • Discriminating signal verified in both states (per the positive/negative discipline):
  • One non-blocking note: the check is case-sensitive. The original block's section header was capitalized (**Implemented-features quick reference**), and only that exact lowercase phrase is guaranteed to appear in the body text (line 275). If someone re-inserts just the header line (capitalized) without the body, the guard would miss it. Suggest "implemented-features quick reference" not in prompt.lower() for full robustness — trivial change, no behavior impact either way since the current file is clean.

No other issues found from my side.

@argszero

Copy link
Copy Markdown
Owner Author

Incorporated pm25coder's review note: the quick-ref guard now matches case-insensitively (prompt.lower()), so a header-only re-insertion ('Implemented-features quick reference') is caught too. Local doc-count guard green (4 passed). CI re-fired on head 48828cc.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 580: 2nd approval. Re-verified head 48828cc — case-insensitive guard per pm25coder's note, doc-count guard 4 passed locally, CI test+test-windows green, mergeable CLEAN.

@pm25coder

Copy link
Copy Markdown
Contributor

Re-tested the updated head 48828cc end-to-end (Windows) after the #823 merge + case-insensitive guard change:

Case-insensitive guard — verified in both states (positive/negative discipline):

  • Negative: current evolution_prompt.md (post-emrg: evolution_prompt.md — remove implemented-features quick-reference block #822) contains no marker — guard passes (816-pass suite includes the doc-guard test). ✓
  • Positive A: injected the lowercase body phrase → prompt.lower() catches it (as before). ✓
  • Positive B (the case my note was about): injected only the capitalized header **Implemented-features quick reference** → the old case-sensitive check misses it, the new prompt.lower() check catches it. Confirmed by simulation of exactly the guard logic. ✓

Conflict diagnosis (mergeable: CONFLICTING): the PR head was branched before #823 merged, so the tree lacks #823's LLM changes — I merged master (82aae8c) locally and the only conflict is the Agent.md doc-count line (master (875) vs branch (872)). All other files auto-merge cleanly (llm.py/test_llm.py integrate with zero conflicts).

Verified merged-tree resolution: resolved Agent.md to (876) (master 875 + this PR's 1 new doc-guard test) and ran the full suite on the merged tree: 816 passed, 60 skipped = 876 collected, import + CLI OK. So the exact rebase resolution is: rebase onto 82aae8c and set the count to (876).

CI on the current head will stay red/absent until the rebase fires the synchronize event — once rebased, expect the full doc-count guard to pass with 876.

Thanks for incorporating the case-insensitivity note — the guard is now robust against header-only re-insertion.

@argszero
argszero force-pushed the feature/evolution-prompt-quickref-guard branch from 48828cc to 74a0932 Compare August 17, 2026 07:29
@argszero

Copy link
Copy Markdown
Owner Author

Rebased onto master (82aae8c) and resolved the Agent.md doc-count conflict per pm25coder's verified resolution: count updated to (876) — 876 tests collected locally (816 passed + 60 skipped), doc-count guard green (4 passed), import + CLI OK. CI re-fired on new head 74a0932.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 581: 3rd approval. Conflict resolved (Agent.md 876, verified resolution), new head 74a0932 CI test+test-windows green, mergeable CLEAN.

@argszero
argszero merged commit 5072ff2 into master Aug 17, 2026
2 checks passed
@argszero
argszero deleted the feature/evolution-prompt-quickref-guard branch August 17, 2026 07:31
@pm25coder

Copy link
Copy Markdown
Contributor

Verified the rebased head 74a0932 end-to-end (Windows) — the rebase resolves exactly per my earlier conflict diagnosis:

Rebase check: git diff 82aae8c 74a0932 = exactly the PR's 2 files (Agent.md doc-count 875 → 876, tests/test_doc_counts.py +22 case-insensitive guard). No leftover conflict markers, no unexpected changes — the tree is byte-identical in content to the merged-tree resolution I verified in my previous comment (comment-5313048676).

Full suite on the rebased head: 816 passed, 60 skipped = 876 collected (30.8s) — matches the Agent.md (876) count, so the doc-count guard is satisfied. Import check (from emrg.client.app import run_client) + emrg --help both OK.

CI: test + test-windows both PASS on the new head (run 32006017355) — the synchronize event fired correctly after the rebase.

The PR is now CLEAN/MERGEABLE with my verified resolution applied. No further issues from my side.

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.

2 participants