Skip to content

fix(claude-code-hermit): preserve factual archive state - #815

Merged
gtapps merged 4 commits into
mainfrom
fix/814-auto-close-factual-archive
Aug 26, 2026
Merged

fix(claude-code-hermit): preserve factual archive state#815
gtapps merged 4 commits into
mainfrom
fix/814-auto-close-factual-archive

Conversation

@gtapps

@gtapps gtapps commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

Make every session archive mode preserve the same on-disk factual baseline. This follows #813 by extending Progress Log preservation to Task, Findings, Blockers, current-session compiled artifacts, and runtime-owned duration data used by briefs and recall.

Changes

  • Read factual report fields from SHELL.md and session-stamped compiled artifacts for idle, close, and auto archives.
  • Accept judgment and handoff fields from the close payload without allowing it to replace recorded facts.
  • Calculate duration only when runtime.json owns the report session, using a valid closed_at or archive time.
  • Keep interrupted-archive recovery diagnostics and existing reflect eligibility behavior intact.
  • Document the unified close contract and add regression coverage across archive modes and runtime ownership cases.

Test plan

  • cd plugins/claude-code-hermit && bun test (4,545 passed, 0 failed)
  • bunx tsc --noEmit (exit 0)
  • cd plugins/claude-code-hermit && bun test tests/session-archive.test.ts (69 passed, 0 failed)

Closes #814

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The idle session skill still supplies blockers only through a payload that the new implementation ignores.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Unifies session archival around SHELL.md facts and runtime-owned duration data.

Changes:

  • Preserves tasks, findings, blockers, artifacts, and duration across archive modes.
  • Updates close guidance and regression coverage.
  • Documents the behavior in the changelog.
File summaries
File Description
scripts/session-archive.ts Implements factual archive baseline and duration ownership.
tests/session-archive.test.ts Adds archive-mode and duration regressions.
skills/session-close/SKILL.md Updates the close contract.
CHANGELOG.md Records the archive fix.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread plugins/claude-code-hermit/scripts/session-archive.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Retained SHELL history can falsely attribute old artifacts to later sessions, and the shipped report template remains inconsistent.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread plugins/claude-code-hermit/scripts/session-archive.ts
Comment thread plugins/claude-code-hermit/scripts/session-archive.ts Outdated
@gtapps
gtapps merged commit 7923c47 into main Aug 26, 2026
4 checks passed
pull Bot pushed a commit to bryanwills/claude-code-hermit that referenced this pull request Aug 26, 2026
…ontext resets

A compaction or clear silently dropped SHELL.md Blockers and Findings, so a
hermit that compacted mid-arc had no way to know it was still blocked and
would re-attempt work the archive (gtapps#815) had already recorded as blocked.
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.

bug: --auto close still drops Task, Findings, Blockers, and declared Artifacts

2 participants