Skip to content

fix(session): unify JSONL persistence and continuation rotation - #84

Merged
M09Ic merged 1 commit into
masterfrom
fix/unified-jsonl-session-rotation
Aug 3, 2026
Merged

fix(session): unify JSONL persistence and continuation rotation#84
M09Ic merged 1 commit into
masterfrom
fix/unified-jsonl-session-rotation

Conversation

@M09Ic

@M09Ic M09Ic commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make *aop.Event the only durable event structure and append it through one App EventBus subscriber as AOP ProtoJSONL
  • persist agent, direct scan, and scanner-native tool artifacts (including gogo results) through that same stream
  • remove checkpoint/snapshot input, ToolDataEvent, ToolArtifact, ArtifactStream, TimelineWriter, timeline parsing, and resume replay/fork pipelines
  • keep progress ephemeral and keep -F as direct AOP JSONL presentation; structured artifact payloads are not converted to Markdown
  • use canonical aop.tool.Artifact / aop.tool.Progress with call_id correlation (depends on feat(aop): correlate tool artifacts and progress cyber-ui#10)

Session semantics

  • -f <path>: stream agent, scan, and artifact AOP events to exactly that JSONL file
  • --save-session: auto-select .aiscan/sessions/session-*.jsonl; REPL mode records automatically
  • -r <path>: restore the latest root-agent continuation and append new events to the same file
  • -r and -f are mutually exclusive; -r may coexist with --save-session and wins
  • /clear: end with cleared and create an empty continuation in the current file
  • /compact: end with compacted and create a continuation containing the compacted context in the current file
  • /resume <path>: when idle, end the current session with resumed, switch the recorder to the target file, and create the continuation there
  • rotation commands reject active runs with /stop guidance
  • child-agent sessions with parent_tool_call_id are excluded from root resume selection

Validation

  • go test ./...
  • go test -tags full ./cmd/aiscan ./examples/acp/server ./tools ./tools/katana
  • go test -race ./core/output ./pkg/runner ./pkg/node ./tools/scan
  • real WSL tmux REPL validation for /clear, /resume, /compact, session parent links, file switching, and end reasons
  • real CLI validation for explicit -f, same-file -r append, -F Markdown rendering, and -r/-f conflict

Dependency: chainreactors/cyber-ui#10

@M09Ic
M09Ic force-pushed the fix/unified-jsonl-session-rotation branch 2 times, most recently from f6478d9 to f0953ac Compare August 3, 2026 07:11
@M09Ic
M09Ic force-pushed the fix/unified-jsonl-session-rotation branch from f0953ac to bdda0af Compare August 3, 2026 08:49
@M09Ic
M09Ic merged commit 1362228 into master Aug 3, 2026
12 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.

1 participant