Repository navigation
Milestone 13: deterministic run archiving and retention controls - #24
Merged
Merged
Conversation
Co-authored-by: anschmieg <6830368+anschmieg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add deterministic run archiving and retention controls
Milestone 13: deterministic run archiving and retention controls
Mar 15, 2026
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.
Adds an explicit lifecycle operation to archive finalized runs, distinguishing preserved historical runs from the active working set — without introducing any backend autonomy.
Protocol (
deterministic-protocol)ArchiveMetadatastruct (reason,archived_at) added toRunStateRunArchiveParams/RunArchiveResulttypesRunsListParamsextended withinclude_archived/archived_onlybooleansRunSummaryandRunGetResultcarry archive fieldsMethod::RunArchive→ wire name"run.archive"Core logic (
deterministic-core)New
run_archivemodule enforces eligibility rules:finalized:completed,finalized:failed,finalized:abandonedrun_archivedaudit entry; does not execute work or reopen the runDaemon (
deterministic-daemon)handle_run_archivedispatches archive operationhandle_runs_listpassesinclude_archived/archived_onlythrough to persistencehandle_run_getexposesarchive_metadatais_archived INTEGER DEFAULT 0andarchive_metadata TEXTtorunstable (safeALTER TABLE ADD COLUMN, backward-compatible)list_runsdefault behavior: excludes archived runs;include_archived=trueshows all;archived_only=trueshows only archivedMCP gateway (
apps/chatgpt-mcp)ArchiveRunInputZod schema (runId,reason1–500 chars)ListRunsInputextended with optionalincludeArchived/archivedOnlybooleansarchive_runtool registered (callsrun.archive); added toREGISTERED_TOOL_NAMESlist_runstool passes archive filter params to daemonTests
Original prompt
This section details on the original issue you should resolve
<issue_title>Milestone 13: deterministic run archiving and retention controls</issue_title>
<issue_description>## Summary
Implement Milestone 13 for ChatCodex: add deterministic run archiving and retention controls so ChatGPT can explicitly archive runs that should remain preserved but no longer appear in the active working set, without introducing backend autonomy.
This milestone builds on the current system, which already includes:
The architecture rule remains absolute:
No backend model calls, no hidden agent loop, and no coarse autonomous tools may be introduced.
Why this milestone
The control plane can now finalize, reopen, and supersede runs, but it still lacks a first-class way to mark old runs as retained history rather than part of the current operational set.
ChatGPT should be able to say things like:
Milestone 13 adds deterministic archival controls so the system can distinguish:
This is about lifecycle hygiene and inspectability, not automation.
In scope
1. Deterministic run archiving
Add an explicit lifecycle operation to archive a run.
At minimum:
2. Deterministic archiving rules
Define straightforward rules such as:
A conservative first version is preferred.
3. Structured archive metadata
Persist compact archive metadata such as:
Keep this compact and deterministic.
4. Authoritative inspection support
Expose archive metadata in:
run.getrun.refreshwhere appropriateruns.listArchived runs should still be visible when explicitly requested, but listing behavior may distinguish them from non-archived runs.
5. Listing and retention behavior
Improve run-list semantics in a tightly scoped way.
At minimum, support deterministic filtering such as:
Keep the result model compact and backward-compatible where practical.
6. Audit trail integration
Append a deterministic audit entry such as:
run_archivedIf helpful, include concise metadata such as archive reason.
7. TypeScript MCP gateway updates
Keep TypeScript thin:
Do not move lifecycle logic into TypeScript.
8. SQLite persistence updates
Persist archive metadata with safe, idempotent migration support.
New databases must work immediately.
Older databases must migrate safely and deterministically.
9. Tests and CI
Add milestone-scoped tests for:
Update CI only as needed for Milestone 13.
Do not broaden CI to the full upstream workspace.
Out of scope
Do not implement:
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.