Skip to content

feat: add read-only lifecycle inspection - #140

Merged
trvon merged 1 commit into
docs/product-testing-contractfrom
feat/lifecycle-inspection
Oct 6, 2026
Merged

trvon merged 1 commit into
docs/product-testing-contractfrom
feat/lifecycle-inspection

Conversation

@trvon

@trvon trvon commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Stack

Depends on #139; targets docs/product-testing-contract. Review this diff after the testing-contract layer. No merge or auto-merge requested.

Changes

  • Add a common lifecycle header to the existing /loop detail inspector: controller kind, resolved storage, authority, lifetime, recorded next fire, accounted budget, pause provenance, and supported next action.
  • Preserve specialized workflow/orchestration details and hybrid event/debounce metadata. Do not display storage paths, event filters, or lease-owner identities in the new fields.
  • Read the existing scheduler's deadline, including its jitter; do not recompute it, pump, rearm, claim work, or change controllers during inspection.
  • Fix Resume being offered for exhausted workflow controller/state fire-cap pauses even though LoopStore.resume rejects 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.

Copilot AI lite review requested due to automatic review settings October 6, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@trvon
trvon added this pull request to stack #141 October 6, 2026 19:35
@trvon
trvon merged commit 53da7be into master Oct 6, 2026
6 checks passed
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