Add progressive NOTE disclosure to comment-memory footer#27848
Add progressive NOTE disclosure to comment-memory footer#27848
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/9d598f1b-9a4b-4dd1-900d-80084b794d67 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/9d598f1b-9a4b-4dd1-900d-80084b794d67 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| // that happen to contain a matching comment-memory tag. | ||
| const MANAGED_COMMENT_PROVENANCE_MARKER = "<!-- gh-aw-agentic-workflow:"; | ||
| const MANAGED_COMMENT_HEADER = "### Comment Memory"; | ||
| const MANAGED_COMMENT_DISCLOSURE_NOTE = [ |
There was a problem hiding this comment.
@copilot refactor text to .md file in actions/setup/md
There was a problem hiding this comment.
Implemented in a7287ea: the disclosure NOTE text is now in /home/runner/work/gh-aw/gh-aw/actions/setup/md/comment_memory_disclosure_note.md, and comment_memory.cjs loads it from that md template.
Screenshot: N/A (no UI change; this is a text-template refactor only).
There was a problem hiding this comment.
Pull request overview
Adds a progressive-disclosure NOTE block to the managed “comment memory” comment body so readers understand what the comment is for, while keeping the memory XML island intact and the generated footer last.
Changes:
- Introduces a new
MANAGED_COMMENT_DISCLOSURE_NOTEmarkdown blockquote (NOTE +<details>/<summary>) inserted before the generated footer. - Extends the
comment_memoryunit test to assert the NOTE is present and ordered between the memory block and the footer.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/comment_memory.cjs | Appends a disclosure NOTE block to managed comment bodies when includeFooter is enabled. |
| actions/setup/js/comment_memory.test.cjs | Updates assertions to validate the NOTE content and placement relative to the memory block and footer. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
| body += "\n\n" + MANAGED_COMMENT_DISCLOSURE_NOTE; | ||
| body += "\n\n" + generateFooterWithMessages(workflowName, runUrl, workflowSource, workflowSourceURL, triggeringIssueNumber, triggeringPRNumber, undefined, historyUrl).trimEnd(); |
There was a problem hiding this comment.
Appending MANAGED_COMMENT_DISCLOSURE_NOTE increases the fixed overhead of managed comments. Since enforceCommentLimits caps bodies at 65,536 chars, this reduces the maximum size available for the user-provided memory block and could cause previously-valid large memories to start failing with E006. Consider reserving space for the note+footer (e.g., truncate/compact the memory content when close to the limit, or emit a more specific error that accounts for footer/note overhead).
| const MANAGED_COMMENT_DISCLOSURE_NOTE = [ | ||
| "> [!NOTE]", | ||
| "> This comment is managed by comment memory.", | ||
| ">", | ||
| "> <details>", | ||
| "> <summary>What this comment does</summary>", | ||
| ">", | ||
| "> It stores persistent context for this thread in the `<gh-aw-comment-memory>` block at the top of this comment.", | ||
| "> Edit only the text in that block; workflow metadata and the footer are regenerated automatically.", | ||
| "> </details>", |
There was a problem hiding this comment.
MANAGED_COMMENT_DISCLOSURE_NOTE hard-codes the tag name (<gh-aw-comment-memory>) even though the actual tag is defined by COMMENT_MEMORY_TAG. This duplicates a source of truth and could become incorrect if the tag constant ever changes. Consider constructing this part of the note from COMMENT_MEMORY_TAG (or describing it without spelling the literal tag).
🧪 Test Quality Sentinel ReportTest Quality Score: 100/100✅ Excellent test quality
Test Classification Details
AnalysisThe PR adds 4 assertions to the existing New assertions (all behavioral):
The ordering assertions (#3 and #4) are particularly strong — they verify a structural invariant (memory → note → footer) that would catch a regression if the block placement logic were accidentally reordered. This goes beyond a simple content-presence check. Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §24782856587
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 100/100. Test quality is excellent — 0% of new test assertions are implementation tests (threshold: 30%). The 4 added assertions verify both content presence and structural ordering invariants for the new disclosure NOTE feature.
|
@copilot review all comments |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/166e5cf2-fed9-4237-a2ce-87e1515f31fb Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| // that happen to contain a matching comment-memory tag. | ||
| const MANAGED_COMMENT_PROVENANCE_MARKER = "<!-- gh-aw-agentic-workflow:"; | ||
| const MANAGED_COMMENT_HEADER = "### Comment Memory"; | ||
| const MANAGED_COMMENT_DISCLOSURE_NOTE = renderTemplateFromFile(path.join(__dirname, "../md/comment_memory_disclosure_note.md"), {}); |
There was a problem hiding this comment.
Implemented in 9f41193 (with lazy-render change introduced in 96a8647): disclosure note rendering is now lazy and performed in the handler path, with cached reuse per handler instance.
Screenshot: N/A (no UI change).
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/8d98ac82-6815-4400-b775-96d88cbe20a5 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/8d98ac82-6815-4400-b775-96d88cbe20a5 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Reviewed all comments and addressed the actionable items in Screenshot: N/A (no UI change). |
make agent-finish) and record pre-existing failuresmake agent-finishbefore final commit and capture results