Skip to content

refactor: make session observation pure - #124

Merged
myobie merged 5 commits into
mainfrom
schickling-assistant/2026-07-30-pure-session-observation
Jul 30, 2026
Merged

refactor: make session observation pure#124
myobie merged 5 commits into
mainfrom
schickling-assistant/2026-07-30-pure-session-observation

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Summary

  • make listSessions() a single-pass, zero-write observation
  • stop creating registry roots or unlinking stale/corrupt/expired artifacts while listing
  • make gc --dry-run byte-for-byte non-mutating and move cleanup exclusively to explicit GC apply
  • preserve live-PID, permanent-session, filter, and daemon-race semantics

This is the first reviewable slice of the pure observation architecture. Follow-ups add typed exact-ID inspect(ids), bounded pure snapshot(), a hard fallback-probe concurrency cap, and generation-checked lifecycle apply.

Verification

  • typecheck: PASS
  • build: PASS
  • focused lifecycle suite: 51/51 PASS
  • full suite: 1436 PASS, 20 skipped, 4 environment-dependent reds reproduced identically on clean base (installed Vim/Nano UI drift and missing zsh)
  • docs verifier: 12/13; the remaining Vim timeout reproduces identically on clean base
  • git diff --check: PASS

No live registry, catalog, or service state was used.

agent-session-id: dev3.dotfiles-cos-misc-agent-runtime-simplification
agent-tool: Codex
agent-tool-version: 0.145.0
agent-model: gpt-5.6-sol
agent-runtime-profile: /home/schickling/.config/coding-agents/profile.json
agent-skills-manifest: /nix/store/nk9iml2841l1yjjg0f6f0d3y60zkg1nn-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@4a0515f
agent-session-id: dev3.dotfiles-cos-misc-agent-runtime-simplification
agent-tool: Codex
agent-tool-version: 0.145.0
agent-model: gpt-5.6-sol
agent-runtime-profile: /home/schickling/.config/coding-agents/profile.json
agent-skills-manifest: /nix/store/nk9iml2841l1yjjg0f6f0d3y60zkg1nn-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@4a0515f
agent-session-id: dev3.dotfiles-cos-misc-agent-runtime-simplification
agent-tool: Codex
agent-tool-version: 0.145.0
agent-model: gpt-5.6-sol
agent-runtime-profile: /home/schickling/.config/coding-agents/profile.json
agent-skills-manifest: /nix/store/nk9iml2841l1yjjg0f6f0d3y60zkg1nn-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@4a0515f

@myobie myobie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Current draft slice is directionally and mechanically green. The read path is actually zero-write, explicit GC owns cleanup, dry-run remains non-mutating, and the per-name lock plus re-inventory closes the important observe/apply race. The new tests cover absent roots, stale/corrupt artifacts, live-owner refusal, changed evidence, reachable sockets, and one-pass vanished reporting.

One non-blocking source correction before ready: the comment above socketCandidates still says a live session is “destroyed here ONLY on POSITIVE proof of death” and describes the old mutating behavior. listSessions no longer destroys anything; rewrite that comment to describe classification/reporting only. I am leaving this as a comment rather than approval because the PR remains draft, not because I found a functional blocker.

@myobie
myobie marked this pull request as ready for review July 30, 2026 13:47

@myobie myobie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One exact comment correction remains. The new socketCandidates comment says an unreadable PID plus unreachable socket “remains ambiguous and is omitted,” but the actual pid === null branch deliberately pushes a session and reports it as running defensively. Please make the comment match that behavior (for example, “remains ambiguous and is reported running defensively”). No functional change or broader rerun is needed beyond the appropriate exact-head checks.

@myobie myobie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved at exact head e95beab. listSessions is a bounded zero-write observation; explicit GC owns cleanup, dry-run remains non-mutating, and cleanup revalidates under the per-name creation lock. The final comment now accurately describes the defensive ambiguous-session classification. Focused, full hosted, typecheck, build, and documentation gates are green.

@myobie
myobie merged commit 7534050 into main Jul 30, 2026
2 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