Skip to content

feat(#555): detect prior assess markers — supersession + churn + conflict prompts - #558

Merged
admarble merged 3 commits into
mainfrom
feature/555-feat-assess-detect-prior-assess-markers-supersessi
May 2, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/555-feat-assess-detect-prior-assess-markers-supersessi

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Adds four pure parser functions (findAllAssessComments, buildSupersessionHeader, detectChurn, shouldPromptOnConflict) so /assess can consult prior <!-- assess:action=... --> markers before posting
  • Documents the supersession + churn + conflict-prompt protocol in /assess SKILL.md across all three skill directories
  • Adds assess-prior-markers.test.ts covering each AC case plus edge cases

AC Verification

AC Description Status Evidence
AC-1 findAllAssessComments returns priors in chronological order ✅ Implemented src/lib/assess-comment-parser.ts:194 + test
AC-2 buildSupersessionHeader 1-prior + count form ✅ Implemented src/lib/assess-comment-parser.ts:520 + tests
AC-3 detectChurn fires only ≥3 priors + no exec markers between ✅ Implemented src/lib/assess-comment-parser.ts:556 + tests
AC-4 shouldPromptOnConflict true only for PROCEED/REWRITE diffs ✅ Implemented src/lib/assess-comment-parser.ts:597 + tests
AC-5 SKILL.md "Prior Assessment Detection" sub-section + 3-dir sync ✅ Implemented All 3 SKILL.md files updated
AC-6 assess-prior-markers.test.ts covers all 4 enumerated cases ✅ Implemented 17 tests passing
AC-7 CHANGELOG [Unreleased] / ### Added entry ✅ Implemented CHANGELOG.md

Test plan

  • npm run build — passes
  • npm run lint — passes
  • npx vitest run src/lib/ — 1997 tests pass (75 files)
  • 3-directory SKILL.md sync verified (assess not in divergence list)
  • Manual smoke test on a real issue with 1+ prior assess comments (deferred to QA)

Closes #555

…lict prompts

Adds four pure parser functions for /assess to consult before posting:
- findAllAssessComments: returns priors in chronological order
- buildSupersessionHeader: 1-prior or N-prior header forms, null for 0
- detectChurn: warns on >=3 priors with no intervening exec phase marker
- shouldPromptOnConflict: only prompts when prior PROCEED/REWRITE differs

Documents the protocol in /assess SKILL.md (3-dir sync) under a new
"Prior Assessment Detection" sub-section in Step 1, with an explicit
read-only rule preserving the append-only audit trail.

Tests cover all four AC cases plus edge cases (exec marker before/after
first prior, missing actions, undefined inputs).
… + Output Verification

QA verdict was AC_MET_BUT_NOT_A_PLUS because the new Prior Assessment
Detection sub-section under Step 1 did not thread into the Persist
Analysis section (where comments are constructed) or the Output
Verification checklist (final integrity check). Closing the gap so a
real /assess invocation reliably prepends the supersession header and
emits the churn warning.

3-dir SKILL.md sync preserved.
…rker

Bug surfaced during dogfood against issue #532 (the literal motivating
example from the #555 issue body): findAllAssessComments returned 0
priors despite 3 real /assess comments existing.

Root cause: isAssessComment matched only prose markers like
"## Assess Analysis" — strings that production /assess output never
contains. Real comments use the dashboard format `→ **PROCEED** — ...`
with the durable HTML marker `<!-- assess:action=PROCEED -->`. The
existing 17 tests passed because fixtures were synthetic
(`## Assess Analysis\n\n→ ...\n\n<!-- assess:action=... -->`) — a body
shape that doesn't exist in production.

Fix: extend isAssessComment to also match
ASSESS_ACTION_MARKER_PATTERN (`<!-- (assess|solve):action=... -->`),
the durable contract written by every /assess comment regardless of
prose format. Add a real-data test using verbatim #532 dashboard
format (no prose header).

Verified end-to-end against #532's 3 real comments:
- findAllAssessComments → 3 priors (was 0)
- buildSupersessionHeader → "Supersedes 3 prior assessments (most recent: 2026-04-26)"
- detectChurn → isChurn=true, count=3, firstDate=2026-04-17
- shouldPromptOnConflict → correct on all 6 action permutations

Full suite: 2712/2712 pass, no regressions.
@admarble
admarble merged commit 4669a49 into main May 2, 2026
8 checks passed
@admarble
admarble deleted the feature/555-feat-assess-detect-prior-assess-markers-supersessi branch May 2, 2026 03:31
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.

feat(assess): detect prior assess markers — supersession note + re-assessment churn warning

1 participant