Repository navigation
feat: add read-only lifecycle inspection - #140
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Adds read-only lifecycle inspection to /loop, including storage, authority, expiry, scheduler deadlines, budgets, pause provenance, and supported actions.
Changes:
- Adds lifecycle presentation and resume eligibility logic.
- Resolves storage scope and exposes scheduler deadlines.
- Adds focused regression tests and usage documentation.
| File | Description |
|---|---|
test/scope.test.ts |
Tests storage-scope classification. |
test/loop-command.test.ts |
Tests inspection and resume behavior. |
test/lifecycle-presentation.test.ts |
Tests lifecycle invariants and privacy. |
src/ui/lifecycle-presentation.ts |
Formats lifecycle details and supported actions. |
src/runtime/scope.ts |
Resolves storage-scope labels. |
src/index.ts |
Supplies inspection context. |
src/commands/loop-command.ts |
Integrates lifecycle inspection into /loop. |
docs/USAGE_GUIDE.md |
Documents inspection behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
Depends on #139; targets
docs/product-testing-contract. Review this diff after the testing-contract layer. No merge or auto-merge requested.Changes
/loopdetail inspector: controller kind, resolved storage, authority, lifetime, recorded next fire, accounted budget, pause provenance, and supported next action.LoopStore.resumerejects it. Keep provenance-sensitive administrative and legacy resume behavior.No new scheduler, controller, removal history, daemon, ordinary wake outbox, or monitor recovery.
Evidence
Bug: unchanged-code behavioral red in both real-store workflow cap cases, with a passing administrative-pause control; same cases now green. Missing lifecycle fields were feature expectations, not additional bug claims.
Feature/invariants: resolved storage precedence (
PI_LOOP, off, memory, bound/unbound session, project/custom), frozen current state, lease/monitor/terminal/expiry distinctions, ownership boundaries, accounting versus delivery, privacy, real scheduler read-through, unsupported actions, and file-backed primary/previous-snapshot preservation. Hybrid detail expectation failed before retention was added, then passed. Four-file final focused suite: 91 tests passed; totals overlap the full suite.Independent review found no blocking regression and identified two coverage gaps, both addressed. Narrow follow-up review found no blocker or misleading invariant in the additions; it confirmed the resume tests do not imply renewed budget or runnable work.
Final gate: 69 files / 1,184 coverage tests passed; statements90.44%, branches84.76%, functions96.43%, lines95.14%. Separate property suite: seven files /22 overlapping tests. Lint passes with the two established warnings; prod/dev typechecks, build, package smoke (123 files/public types), audit (zero vulnerabilities), fresh LSP and diff checks pass. Signed tip:
67c4d4e7944dd3d08b74fa00dc5cd265613426b2.This PR establishes inspection behavior, not measured user effectiveness. The proposed operator study remains unrun; no time-to-diagnose or unsafe-action rate is claimed.