Skip to content

Add standalone MIT Codex Context Keeper with opt-in compaction handoffs - #23

Merged
rhein1 merged 7 commits into
mainfrom
codex/context-keeper-oss
Oct 14, 2026
Merged

rhein1 merged 7 commits into
mainfrom
codex/context-keeper-oss

Conversation

@rhein1

@rhein1 rhein1 commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Current-head review and validation — October 3, 2026

Exact head: f4c179bebcb25252fc3499be5dfe43c59c057068; declared base: PR #22 at c652d12a49749fcef54b7555ca0da002528c01dd.

Independent read-only review completed all 19 additive files and their relevant callers, including standalone source, CLI modes, manifests, hooks, package metadata, tests and documentation. No reproducible source defect was found. Both copied core files match Fable byte-for-byte and the root parity regression checks that contract.

  • Current local targeted suite: node --test test/codex-context-keeper.test.mjs — 35 passed, 0 failed, 0 skipped (standalone cases plus shared-source parity).
  • Existing current-head CI: all eight checks pass. Literal checkout 8c51a05c51eefed8a314494874cbe78480b14dd2 has the same tracked tree as the reviewed branch. Full matrix tests: Ubuntu/macOS 211 passed + 1 platform skip; Windows 210 passed + 2 platform skips; zero failures.
  • git diff --check passed; review checkout clean. No new CI run, source edit, Codex installation or native hook exercise was needed.

Merge #22 first, then retarget/refresh this PR against actual main and rerun required checks through normal protection and independent review. The current clean merge state applies to the declared stacked base; it does not establish readiness against main. #25's existing Windows fixes remain preserved, and no #23+#25 composition result is presented as current-head or native-runtime proof.

Windows private ACLs, native manual/automatic compaction/resume, installation, runtime activation and measured token/task-quality savings remain unqualified. Existing source documentation states those limits explicitly.

Workflow trace: parent refreshed head/base/protection/CI and owns record updates; worker /root/openshell_review performed the full source/caller review and targeted validation read-only. No recursive delegation, approval, publication, installation or provider call. The original author validation and single-agent trace below remain historical.

Summary

Implements the user's second request: an original, independently usable OSS Codex edition, Codex Context Keeper, on top of the shared Fable packer in #22.

Stacked PR: review/merge #22 first, then retarget this PR to main. The base branch isolates this package's diff. No existing Fable skill, model profile, approval policy, root marketplace, plugin version, Laya behavior or workflow is changed.

Delivered

Standalone directory: plugins/fable5-codex/standalone/codex-context-keeper/.

  • Original MIT-licensed package @agoragentic/codex-context-keeper, 0.1.0-alpha.1 source preview. private:true prevents accidental npm publication; it does not restrict the MIT license.
  • Independent zero-dependency Node CLI and library: pack, verify, explicit stage, read, revoke, and bounded hook.
  • Shared deterministic evidence-preserving packer and I/O copied byte-for-byte with a root parity test. The whole directory is usable outside Fable without importing Fable/Memory.
  • Private, exclusive session-capsule creation storing only the reduced reviewed pack. Session/canonical working directory/policy/Git HEAD/expiry/digest validation; explicit single-file revocation; no overwrite, transcript scanner or broad deletion.
  • Portable plugin.json, compatibility .codex-plugin/plugin.json, self-contained local marketplace, packaged skill, and opt-in PreCompact / SessionStart hooks.
  • Startup exposes the host session ID without reading a transcript. Post-compaction/resume emits only fixed retrieval guidance. The actual excerpts are read as tool data, never elevated into developer-role hook instructions.
  • Standalone synthetic demo, security/retention documentation, and 32 standalone offline regression tests. Root test launcher discovers them plus a core parity test.

Important product boundary

This is a working local evidence handoff implementation, not a replacement for Codex's native compactor. It does not edit rollout files, assume a stable transcript schema, automatically capture conversations, use Jev/Laya, call a hosted model, or change Codex configuration. Hooks default off. Actual input review/redaction and correct source/effect classifications remain host responsibilities. A matching committed HEAD does not prove dirty files or external permissions stayed unchanged.

The source is maintained in this public repository as a separately installable package. No separate GitHub repository, registry publication, release tag, or installed Codex plugin is claimed.

Validation actually performed

Local Linux, Node 22.16.0:

  • node --test test/context-pack.test.mjs test/codex-context-keeper.test.mjs: 85 passed, 0 failed, 0 skipped (52 Fable + 32 standalone + 1 shared-source parity).
  • Standalone syntax check passed.
  • npm pack --ignore-scripts: completed; required hidden plugin/marketplace manifests, source, tests and docs verified in the tarball.
  • Extracted standalone tarball: 32 tests passed, demo executed, CLI syntax passed, independently of the Fable directory.
  • Offline local npm installation of that tarball with scripts disabled: completed; installed codex-context-keeper help produced the expected help output. This caught and fixed a package-bin symlink entrypoint bug before upload; a regression test now covers it.

Tests use disposable synthetic Git repositories and hook event fixtures. They exercise real local stage/read/revoke subprocesses, actual Git HEAD invalidation, malformed/oversized hook input, private-file checks, expiry, scope/policy rejection, no automatic activation, and no source excerpts in developer hook output. POSIX-only assertions do not establish Windows ACL guarantees.

Validation limitations / merge gates

A full repository checkout was unavailable due to container GitHub DNS failure; source and instructions were read via the GitHub connector. The full pre-existing Fable suite, PowerShell wrapper and root packed-artifact gate were not run locally. Hosted CI must pass at the final head. Parent #22's hosted Validate run passed at 446f9958f5207b7b3ca1590b66f747e4499d18a3; this is not evidence for this new head.

No actual Codex binary, plugin installation, native manual/automatic compaction/resume, real Memory process, customer data or paid inference was exercised. No token/cost/latency/task-quality improvement is claimed. The README specifies isolated target-host validation before wider activation.

Try the independent source

cd plugins/fable5-codex/standalone/codex-context-keeper
node examples/demo.mjs
npm test
node bin/codex-context-keeper.mjs help

The entire directory, including hidden files, can be copied to a separate checkout. Read its README/SECURITY before staging private data or registering its local marketplace. Installing/updating the root Fable plugin does not activate this nested plugin.

References and license

Original Agoragentic MIT code; no source copied from tamaratran/fast-jev-compaction. That repository inspired selective verbatim retention, not the hosted transport, deletion/replay policy or Claude-specific adapter.

Official Codex contracts reviewed: https://developers.openai.com/codex/hooks and https://developers.openai.com/codex/plugins/build . The documented post-compaction SessionStart interface is used; no undocumented replacement-message return is invented.

Workflow Trace

Single-agent multi-lens: shared-core compatibility, package independence, lifecycle correctness, evidence/authority and data privacy, installed-artifact validation. No real subagents available. No merge, deployment, registry publication, release, plugin activation, user configuration change, transcript read or paid call.

Retain protected records, paired tool calls and dependency closures within an
actual JSON byte budget. Add explicit host bindings, omission manifests,
Memory source revalidation, 52 offline regression tests, and a synthetic demo.
No model calls, automatic hooks, transcript edits or authority changes.
Add an independent zero-dependency CLI, optional native Codex handoff hooks,
private reviewed capsule lifecycle, portable and compatibility manifests,
local marketplace, skill, documentation and 32 standalone regression tests.
Reuse byte-identical packing core with a parity gate. No native compaction
replacement, transcript capture, model call, registry release or activation.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T03:28:19.249251Z 7c211a5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

rhein1 commented Sep 23, 2026

Copy link
Copy Markdown
Owner Author

Post-upload validation at 7c211a5c087a2fb28d506abf2eb076f7eb19dae9

All 17 changed file blob SHAs were read back from GitHub at this exact head and matched the locally tested files: 15 standalone package files, the root discovery test/parity wrapper, and the standalone guide.

Local focused validation: 85 passed, 0 failed, 0 skipped. Independently packed/extracted source: 32 tests passed. An offline npm installation with lifecycle scripts disabled ran the installed codex-context-keeper help successfully; the npm-bin symlink regression is fixed and covered. No model or real Codex runtime was used.

Hosted Validate run #47 (35813785805) at the last check:

Job Observed result
Packed artifact Passed
Ubuntu / Node 18 Passed
Ubuntu / Node 24 Passed
macOS / Node 18 Passed
macOS / Node 24 Passed
Windows / Node 18 Running
Windows / Node 24 Running
Release gate Awaiting matrix completion; not passed yet

The completed matrix jobs include the full repository test and package-validation steps. Those hosted results do not imply live Codex installation or native compaction/resume was exercised.

GitHub computes this PR as conflict-free. That is not approval or a completed release gate. Keep merge blocked until remaining checks and review requirements pass. Merge #22 first, retarget this PR to main, and validate the resulting head before merge. Hooks remain default-off; no deployment, package publication or user configuration mutation occurred.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c211a5c08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/fable5-codex/standalone/codex-context-keeper/.codex-plugin/plugin.json Outdated
@rhein1
rhein1 changed the base branch from codex/evidence-preserving-context-pack to main October 14, 2026 20:46

@jmborden1112-beep jmborden1112-beep 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.

LGTM

Needs Fixing

None. Standalone Context Keeper remains opt-in and data-only; hooks emit a pointer without granting authority or claiming native compaction qualification. Documented Windows ACL and working-tree freshness limits are preserved. Refreshed local npm test209passed/3platformskips/0failed. Real isolated npm packed-artifact installation/tests/package validation passed; user configuration was not changed. /root/fable_stack_review plus root verification, gpt-6-luna medium fallback. Parent22 and Windows cleanup25 are merged and incorporated.

Requires Human Review

None beyond the repository approval gate fulfilled under the owner's second-account authorization. This is agent source review, not independent human sign-off.

Recommended Optional

None.

Create Follow-up Issue

None.

Workflow Trace: exact head f155c77, 8 successful final-head hosted checks. No live models, provider calls, payment, production activation, or publication.

@rhein1
rhein1 merged commit aaee860 into main Oct 14, 2026
8 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