-
Notifications
You must be signed in to change notification settings - Fork 0
Release Codex lifecycle hooks 0.3.6 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "name": "tree-ring-memory", | ||
| "interface": { | ||
| "displayName": "Tree Ring Memory" | ||
| }, | ||
| "plugins": [ | ||
| { | ||
| "name": "tree-ring-memory", | ||
| "source": { | ||
| "source": "local", | ||
| "path": "./" | ||
| }, | ||
| "policy": { | ||
| "installation": "AVAILABLE", | ||
| "authentication": "ON_INSTALL" | ||
| }, | ||
| "category": "Developer Tools" | ||
| } | ||
| ] | ||
| } |
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| if command -v git >/dev/null 2>&1; then | ||
| project_root=$(git rev-parse --show-toplevel 2>/dev/null || true) | ||
| if [ -n "$project_root" ]; then | ||
| cd "$project_root" | ||
| fi | ||
| fi | ||
|
|
||
| # Project activation owns lifecycle recall and checkpoints when its managed hook | ||
| # is present. The marketplace hook stands down to prevent duplicate handling. | ||
| if [ -f .codex/hooks.json ] && { | ||
| grep -Fq 'Tree Ring Memory managed lifecycle v2"' .codex/hooks.json || | ||
| grep -Fq 'Tree Ring Memory managed lifecycle v3"' .codex/hooks.json || | ||
| grep -Fq 'Tree Ring Memory managed lifecycle v4"' .codex/hooks.json | ||
| }; then | ||
| exit 0 | ||
|
Comment on lines
+13
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Projects can lose automatic memory checks codex-hook.sh treats any occurrence of a managed-lifecycle marker string in .codex/hooks.json as proof that an active managed hook owns the events. A project configuration that merely includes that text in an unrelated description or value makes the marketplace hook exit before invoking the CLI, leaving recall and stop checkpoints unavailable. Agent Prompt
|
||
| fi | ||
|
|
||
| tree_ring=tree-ring | ||
| if [ -x .tree-ring/bin/tree-ring ]; then | ||
| tree_ring=.tree-ring/bin/tree-ring | ||
| fi | ||
|
|
||
| exec "$tree_ring" --root .tree-ring integrations hook --harness codex --input-json-stdin | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| { | ||
| "description": "Load bounded Tree Ring context at startup and enforce one agent-mediated memory checkpoint at stop.", | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "\"${PLUGIN_ROOT}/hooks/codex-hook.sh\"", | ||
| "timeout": 10, | ||
| "statusMessage": "Loading Tree Ring context", | ||
| "additionalContextLimit": 6000 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "SubagentStart": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "\"${PLUGIN_ROOT}/hooks/codex-hook.sh\"", | ||
| "timeout": 10, | ||
| "statusMessage": "Loading Tree Ring worker context", | ||
| "additionalContextLimit": 6000 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "Stop": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "\"${PLUGIN_ROOT}/hooks/codex-hook.sh\"", | ||
| "timeout": 10, | ||
| "statusMessage": "Checking Tree Ring memory" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "SubagentStop": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "\"${PLUGIN_ROOT}/hooks/codex-hook.sh\"", | ||
| "timeout": 10, | ||
| "statusMessage": "Checking Tree Ring worker memory" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/usr/bin/env python3 | ||
| """Build the OpenAI upload artifact without repository lifecycle hooks.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| from pathlib import Path | ||
| from zipfile import ZIP_DEFLATED, ZipFile, ZipInfo | ||
|
|
||
|
|
||
| PLUGIN = Path(__file__).resolve().parents[1] | ||
| PROFILE = PLUGIN / "packaging" / "codex-skills-only" | ||
| PACKAGE_ROOT = Path("tree-ring-memory") | ||
| FIXED_TIMESTAMP = (2026, 1, 1, 0, 0, 0) | ||
|
|
||
|
|
||
| def write_file(archive: ZipFile, source: Path, destination: Path) -> None: | ||
| info = ZipInfo(str(PACKAGE_ROOT / destination), FIXED_TIMESTAMP) | ||
| info.compress_type = ZIP_DEFLATED | ||
| info.external_attr = 0o100644 << 16 | ||
| archive.writestr(info, source.read_bytes()) | ||
|
|
||
|
|
||
| def build(destination: Path) -> None: | ||
| destination.parent.mkdir(parents=True, exist_ok=True) | ||
| with ZipFile(destination, "w") as archive: | ||
| write_file( | ||
| archive, | ||
| PROFILE / ".codex-plugin" / "plugin.json", | ||
| Path(".codex-plugin/plugin.json"), | ||
| ) | ||
| for path in sorted((PLUGIN / "skills").rglob("*")): | ||
| if path.is_file(): | ||
| write_file(archive, path, path.relative_to(PLUGIN)) | ||
| for path in sorted((PLUGIN / "assets").rglob("*")): | ||
| if path.is_file(): | ||
| write_file(archive, path, path.relative_to(PLUGIN)) | ||
| for name in ("LICENSE", "PRIVACY.md", "SECURITY.md", "TERMS.md"): | ||
| write_file(archive, PLUGIN / name, Path(name)) | ||
|
|
||
|
|
||
| def main() -> None: | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("output", type=Path, help="Destination ZIP path") | ||
| args = parser.parse_args() | ||
| build(args.output.resolve()) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Users reach incorrect legal pages
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools