Establish the initial 0.1.0 release - #1
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAmnestic Trace adds a Rust runtime for journal-based working-memory capture, bounded extraction, snapshot storage, recall, handoff, and inspection. It also adds Claude Code and Codex plugins, shell adapters, CI and release workflows, supply-chain policy, licenses, and documentation. ChangesAmnestic Trace runtime
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Hook as Compaction or recall hook
participant CLI as amtr CLI
participant Journal as Journal reader
participant Agent as Extraction agent
participant Store as Session store
Hook->>CLI: invoke synthesis or recall
CLI->>Journal: read bounded journal window
CLI->>Agent: run restricted extraction
Agent-->>CLI: return validated handoff
CLI->>Store: persist or claim snapshot
Store-->>CLI: return restoration output
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments (6)
src/journal.rs (1)
452-505: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueGate the 128 MiB journal test behind an opt-in.
The test writes over 128 MiB to the system temp directory on every
cargo testrun. On a constrained CI runner this consumes wall time and disk. Keep the coverage, but mark it#[ignore]and run it in a dedicated CI step, or reduce the fixture to just above the boundary the test needs.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/journal.rs` around lines 452 - 505, Mark read_window_streams_a_journal_larger_than_would_fit_in_a_string with #[ignore] so the over-128 MiB fixture is not created during normal cargo test runs, while preserving the existing coverage for dedicated execution.src/store.rs (2)
183-188: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAlign
find_by_keywithrows()on a missing cortex directory.
rows()mapsNotFoundonread_dirto an empty result.find_by_keypropagates the error. A store opened throughopen_existing()never createsCORTEX, so a base directory without the cortex subdirectory turns a plain "no such key" into an I/O error for any caller that resolves a key against such a store.♻️ Proposed change
pub fn find_by_key(&self, amtr_key: &str) -> io::Result<Option<Row>> { - for entry in fs::read_dir(self.base.join(CORTEX))?.flatten() { + let entries = match fs::read_dir(self.cortex()) { + Ok(entries) => entries, + Err(error) if error.kind() == io::ErrorKind::NotFound => return Ok(None), + Err(error) => return Err(error), + }; + for entry in entries.flatten() {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/store.rs` around lines 183 - 188, Update find_by_key to handle a missing CORTEX directory like rows(), converting read_dir’s NotFound error into an empty search result while propagating other I/O errors. Preserve the existing JSON filtering and key lookup behavior for an existing directory.
345-365: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winRemove the temporary file when the write fails.
If
write_all,sync_all, oropenfails, the function returns early and leaves<name>.tmp.<pid>in the cortex directory.prepare_debtinsrc/synthesize.rssweeps only.delivering.,.expiring., and.publishing.candidates, so these.tmp.files stay forever. They are also skipped byrows()andfind_by_keybecause of the extension filter, so the leak is silent.♻️ Proposed change
- { - let mut opts = fs::OpenOptions::new(); - opts.write(true).create(true).truncate(true); - #[cfg(unix)] - { - use std::os::unix::fs::OpenOptionsExt; - opts.mode(0o600); - } - let mut f = opts.open(&tmp)?; - f.write_all(body)?; - f.sync_all()?; - } - fs::rename(&tmp, path) + let write = (|| -> io::Result<()> { + let mut opts = fs::OpenOptions::new(); + opts.write(true).create(true).truncate(true); + #[cfg(unix)] + { + use std::os::unix::fs::OpenOptionsExt; + opts.mode(0o600); + } + let mut f = opts.open(&tmp)?; + f.write_all(body)?; + f.sync_all() + })(); + if let Err(error) = write { + let _ = fs::remove_file(&tmp); + return Err(error); + } + if let Err(error) = fs::rename(&tmp, path) { + let _ = fs::remove_file(&tmp); + return Err(error); + } + Ok(())🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/store.rs` around lines 345 - 365, Update write_atomic to remove the generated temporary path when opening, writing, or syncing fails, while preserving the original error and leaving successful rename behavior unchanged. Ensure cleanup also covers failures within the temporary-file operation before returning from the function.src/synthesize.rs (1)
46-53: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMake the two-candidate selection explicit.
The chain applies
.filter(|path| path.is_file())twice. The second filter re-tests atranscript_paththat the first filter already accepted. The result is correct, but a reader has to trace both arms to confirm thatrollout_pathis checked at all.♻️ Proposed change
fn journal(&self) -> Option<PathBuf> { - self.transcript_path - .clone() - .filter(|path| path.is_file()) - .or_else(|| self.rollout_path.clone()) - .filter(|path| path.is_file()) - .or_else(|| find_codex_journal(&self.session_id)) + [&self.transcript_path, &self.rollout_path] + .into_iter() + .flatten() + .find(|path| path.is_file()) + .cloned() + .or_else(|| find_codex_journal(&self.session_id)) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/synthesize.rs` around lines 46 - 53, Make the candidate selection in journal explicit: validate transcript_path once, then independently validate rollout_path before falling back to find_codex_journal(&self.session_id). Avoid chaining the second filter onto the already-filtered result, while preserving the existing file checks and fallback order.src/extract.rs (1)
265-270: 🩺 Stability & Availability | 🔵 Trivial | ⚖️ Poor tradeoffConsider killing the whole agent process group on timeout.
The worker already runs in its own session after
detach(). Put the agent in its own process group withpre_execandsetpgid, then send the signal to that group. This reaps descendants that the CLI spawned instead of orphaning them for the remaining lifetime of the machine.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/extract.rs` around lines 265 - 270, Update the child-process setup to use pre_exec with setpgid, placing the extraction agent in its own process group after detach(). In the timeout branch of the extraction flow, signal the entire process group rather than only child, then wait as before so spawned descendants are reaped.plugin/skills/amtr/SKILL.md (1)
15-19: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd a language to the two fenced code blocks.
markdownlint reports MD040 for both blocks. Use
textto keep them unhighlighted.♻️ Proposed fix
-``` +```text /amtr name this session's own key, to give to another session-``` +```text /amtr <the key you just printed>Also applies to: 109-111
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugin/skills/amtr/SKILL.md` around lines 15 - 19, Update the two fenced code blocks in the amtr skill documentation to specify the text language, preserving their contents and unhighlighted presentation.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 105-109: Update the cargo deny check step to pass the --locked
flag, ensuring it uses the existing Cargo.lock without modifying the dependency
graph. Keep the existing advisories, bans, sources, and licenses checks
unchanged.
In @.github/workflows/release.yml:
- Around line 70-95: Before the build steps in the release workflow, add
validation that compares the version derived from GITHUB_REF_NAME#v with the
package version in Cargo.toml and the versions in both plugin manifests. Fail
the workflow with a clear error if any value differs; otherwise allow the
existing archive and release-name flow to continue unchanged.
In `@plugin/README.md`:
- Around line 3-5: Update the introduction text around the plugin hook
description to accurately document all four hook events: PreCompact,
SessionStart, PreToolUse, and UserPromptSubmit. Replace “three hooks” with
either “one capture hook and three delivery hooks” or “four hook events,”
preserving the surrounding wording.
- Around line 176-183: Update the README’s default-prompt redirection example to
use the active data root returned by the prompt path resolution, such as the
path under the configured ~/.amtr store when selected, so it matches
prompt_path() and customizes the active prompt. Adjust the surrounding
persistence guidance only as needed to keep the documented upgrade behavior
accurate.
- Around line 104-106: Disable the automatic Codex extraction path by default in
the documented configuration and require explicit opt-in, preferably through an
isolated Codex home/configuration that disables MCP servers and hosted
network-capable tools. Update the extraction command accordingly, and add
regression coverage using the exact command to verify the journal cannot read a
local canary file or access a reachable remote URL.
In `@plugin/tools/amtr-hook.sh`:
- Around line 17-18: Update the PATH construction near the existing HOME guard
in amtr-hook.sh to safely handle an unset PATH under set -u, using the same
defaulting pattern already applied to HOME, while preserving the current
appended bin directories and export behavior.
In `@src/detach.rs`:
- Around line 34-98: Gate the detach module and its Unix-specific APIs behind
#[cfg(unix)] so symbols such as log_stderr_to and detach are not compiled on
unsupported platforms. Ensure the crate still builds on non-Unix targets by
providing the appropriate existing or minimal not(unix) fallback for any
required public interface.
In `@src/extract.rs`:
- Around line 260-272: Update stderr handling around the extraction timeout,
failed-status, and validation paths so joining the stderr reader cannot block
indefinitely when descendants retain the pipe. Bound the reader join with a
channel and deadline, degrading to an empty note and leaving the thread detached
if it does not finish; ensure all error paths, including the timeout branch in
the extraction loop, still return and allow marker cleanup.
In `@src/recall.rs`:
- Around line 397-403: Update report_key to call
store::validate_session_id(session_id)? before Store::open() and any row
loading, preserving the existing return behavior after validation.
In `@src/store.rs`:
- Around line 43-47: Add rust-version = "1.85.0" to Cargo.toml to explicitly
enforce the minimum compiler required by the edition 2024 let-chains in
src/journal.rs (lines 212-217) and std::env::home_dir() usage in src/store.rs
(lines 43-47); no direct code changes are needed in either Rust source site.
---
Nitpick comments:
In `@plugin/skills/amtr/SKILL.md`:
- Around line 15-19: Update the two fenced code blocks in the amtr skill
documentation to specify the text language, preserving their contents and
unhighlighted presentation.
In `@src/extract.rs`:
- Around line 265-270: Update the child-process setup to use pre_exec with
setpgid, placing the extraction agent in its own process group after detach().
In the timeout branch of the extraction flow, signal the entire process group
rather than only child, then wait as before so spawned descendants are reaped.
In `@src/journal.rs`:
- Around line 452-505: Mark
read_window_streams_a_journal_larger_than_would_fit_in_a_string with #[ignore]
so the over-128 MiB fixture is not created during normal cargo test runs, while
preserving the existing coverage for dedicated execution.
In `@src/store.rs`:
- Around line 183-188: Update find_by_key to handle a missing CORTEX directory
like rows(), converting read_dir’s NotFound error into an empty search result
while propagating other I/O errors. Preserve the existing JSON filtering and key
lookup behavior for an existing directory.
- Around line 345-365: Update write_atomic to remove the generated temporary
path when opening, writing, or syncing fails, while preserving the original
error and leaving successful rename behavior unchanged. Ensure cleanup also
covers failures within the temporary-file operation before returning from the
function.
In `@src/synthesize.rs`:
- Around line 46-53: Make the candidate selection in journal explicit: validate
transcript_path once, then independently validate rollout_path before falling
back to find_codex_journal(&self.session_id). Avoid chaining the second filter
onto the already-filtered result, while preserving the existing file checks and
fallback order.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1b03f6a0-8f2b-44e9-a597-a850d521f5e5
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (27)
.claude-plugin/marketplace.json.github/workflows/ci.yml.github/workflows/release.ymlCHANGELOG.mdCONTRIBUTING.mdCargo.tomlLICENSE-APACHELICENSE-MITREADME.mddeny.tomlplugin/.claude-plugin/plugin.jsonplugin/.codex-plugin/plugin.jsonplugin/README.mdplugin/hooks/claude.jsonplugin/hooks/codex.jsonplugin/skills/amtr/SKILL.mdplugin/tools/amtr-hook.shsrc/default-prompt.mdsrc/detach.rssrc/extract.rssrc/journal.rssrc/main.rssrc/peek.rssrc/recall.rssrc/store.rssrc/synthesize.rstests/hook-regressions.sh
| The agent's input is a session journal, which contains text this tool did not | ||
| author — fetched pages, dependency output, error messages. Text like that can | ||
| try to steer whatever reads it. |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -u
# Trace the Codex extraction command and isolation flags.
rg -n -C 10 --glob '*.rs' --glob '*.sh' \
'Command::new|--sandbox|features\.shell_tool|mcp_servers|codex'Repository: naoto256/amnestic-trace
Length of output: 161
🏁 Script executed:
#!/bin/bash
set -u
echo "== files =="
git ls-files | sed -n '1,120p'
echo "== plugin README relevant sections =="
if [ -f plugin/README.md ]; then
nl -ba plugin/README.md | sed -n '90,155p'
fi
echo "== repo-wide search relevant terms =="
rg -n -C 3 --glob '!target/**' --glob '!dist/**' --glob '!build/**' \
'codex|Codex|PreCompact|precompact|features\.shell_tool|shell_tool|commands|mcp_servers|--sandbox|-c |sandbox|network|exfil|file access' . || trueRepository: naoto256/amnestic-trace
Length of output: 34651
🌐 Web query:
openai/codex #16045 mcp_servers={} no-op configured servers
💡 Result:
The issue openai/codex #16045`` refers to a bug where using -c 'mcp_servers={}' at the command line does not clear configured MCP servers as intended [1][2]. Instead of overwriting the configuration, the empty TOML table `{}` performs a non-destructive merge with existing settings, leaving all previously configured servers enabled [1]. This behavior is problematic for users who want to run lightweight, isolated sessions without the overhead of MCP server discovery or tool loading [1]. Related issues confirm that empty `[mcp_servers]` tables in other configuration layers—such as `[profiles]` or agent role files—similarly fail to shadow or clear inherited global MCP server configurations [3][4][5]. As of August 2026, the following workarounds and context are relevant: Workarounds: - Per-server disabling: You must explicitly disable each server individually using command-line flags (e.g., `-c 'mcp_servers.SERVER_NAME.enabled=false'`) [1]. - Separate configuration files: For profiles or agent roles, a common workaround is to use an entirely separate configuration file that excludes the unwanted MCP server definitions [5]. Status: - The issue remains open as of early 2026 [1][4]. - Developers have suggested future fixes such as treating an empty `mcp_servers` table as a "replace" operation rather than a "merge" operation, or implementing a dedicated flag like `--no-mcp` [1]. - Future architectural changes to Codex profiles are expected to address limitations in how nested configuration sections (including `mcp_servers`) are inherited and overridden [6].
Citations:
- 1: bug: -c 'mcp_servers={}' silently no-ops instead of clearing MCP servers openai/codex#16045
- 2: https://codexissues.com/issue/16045-bug-c-mcp-servers-silently-no-ops-instead-of-clearing-mcp-servers
- 3: [profiles] Empty mcp_servers in profile does not shadow global mcp_servers openai/codex#17503
- 4: Empty [mcp_servers] in agent role files does not clear inherited MCP servers openai/codex#16686
- 5: https://www.stepcodex.com/en/issue/profiles-empty-mcp-servers-in-profile
- 6: Config/profile disables for connectors, apps, and plugins are ignored in Codex CLI openai/codex#17588
Disable Codex extraction by default until hosted tools can be disabled.
The Codex extraction path runs journal text through codex exec with only features.shell_tool=false, --sandbox read-only, and -c mcp_servers={}. The shell tool is disabled, but mcp_servers={} does not clear configured MCP servers, and hosted tools can still receive the journal contents and send data off machine.
Since this compaction trigger runs automatically, make Codex extraction optional or require an opt-in isolated Codex home/configuration that disables MCP servers and hosted network-capable tools. Add regression coverage that checks a local canary file and a reachable remote URL under the exact extraction command.
🧰 Tools
🪛 LanguageTool
[grammar] ~106-~106: Ensure spelling is correct
Context: ...ssages. Text like that can try to steer whatever reads it. - Claude Code: launched ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugin/README.md` around lines 104 - 106, Disable the automatic Codex
extraction path by default in the documented configuration and require explicit
opt-in, preferably through an isolated Codex home/configuration that disables
MCP servers and hosted network-capable tools. Update the extraction command
accordingly, and add regression coverage using the exact command to verify the
journal cannot read a local canary file or access a reachable remote URL.
| PATH="$PATH:$home/.local/bin:$home/.cargo/bin:/opt/homebrew/bin:/usr/local/bin" | ||
| export PATH |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Guard $PATH the same way as $HOME.
set -u is active. If the host does not export PATH, line 17 aborts the script with a non-zero status, and the host event sees a failed hook. Line 7 already applies this guard to HOME.
🛡️ Proposed fix
-PATH="$PATH:$home/.local/bin:$home/.cargo/bin:/opt/homebrew/bin:/usr/local/bin"
+PATH="${PATH:-/usr/bin:/bin}:$home/.local/bin:$home/.cargo/bin:/opt/homebrew/bin:/usr/local/bin"
export PATH📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| PATH="$PATH:$home/.local/bin:$home/.cargo/bin:/opt/homebrew/bin:/usr/local/bin" | |
| export PATH | |
| PATH="${PATH:-/usr/bin:/bin}:$home/.local/bin:$home/.cargo/bin:/opt/homebrew/bin:/usr/local/bin" | |
| export PATH |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugin/tools/amtr-hook.sh` around lines 17 - 18, Update the PATH construction
near the existing HOME guard in amtr-hook.sh to safely handle an unset PATH
under set -u, using the same defaulting pattern already applied to HOME, while
preserving the current appended bin directories and export behavior.
| pub fn log_stderr_to(dir: &Path) { | ||
| let _ = std::fs::create_dir_all(dir); | ||
| let log_path = dir.join("amtr.log"); | ||
| if std::fs::metadata(&log_path).is_ok_and(|m| m.len() > MAX_LOG_BYTES) { | ||
| let _ = std::fs::remove_file(&log_path); | ||
| } | ||
|
|
||
| let mut buf = log_path.as_os_str().as_encoded_bytes().to_vec(); | ||
| buf.push(0); | ||
| unsafe { | ||
| let fd = libc::open( | ||
| buf.as_ptr() as *const libc::c_char, | ||
| libc::O_WRONLY | libc::O_CREAT | libc::O_APPEND, | ||
| 0o600 as libc::c_uint, | ||
| ); | ||
| if fd >= 0 { | ||
| libc::dup2(fd, 2); | ||
| if fd > 2 { | ||
| libc::close(fd); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// Detaches the worker from the host's process group. The caller returns | ||
| /// immediately in the original process, so the hook exits while extraction runs | ||
| /// in parallel with compaction itself. | ||
| /// | ||
| /// # Assumes a single-threaded process | ||
| /// | ||
| /// `fork` carries over only the calling thread. A lock held by any other thread | ||
| /// at that instant stays locked forever in the child, and the allocator's is | ||
| /// enough to hang it on the next allocation. Nothing before this point starts a | ||
| /// thread — the extraction subprocess's reader and writer come after — and | ||
| /// anything that changes must keep it that way or move the fork ahead of | ||
| /// itself. | ||
| pub fn detach() -> Role { | ||
| unsafe { | ||
| match libc::fork() { | ||
| -1 => return Role::CannotDetach, | ||
| 0 => {} | ||
| _ => return Role::Caller, // original process: hook returns now | ||
| } | ||
| // New session: we are no longer in the host's process group, so a | ||
| // group-wide kill on hook timeout does not reach us. | ||
| libc::setsid(); | ||
| match libc::fork() { | ||
| -1 => {} | ||
| 0 => {} | ||
| _ => libc::_exit(0), // reparented to init, so nobody waits on us | ||
| } | ||
| // Close the hook's stdin and stdout; a host that reads them to EOF | ||
| // would otherwise block on a worker that outlives it. stderr is left | ||
| // alone: it already points at the log, opened before any of this. | ||
| let devnull = libc::open(c"/dev/null".as_ptr(), libc::O_RDWR); | ||
| if devnull >= 0 { | ||
| libc::dup2(devnull, 0); | ||
| libc::dup2(devnull, 1); | ||
| if devnull > 2 { | ||
| libc::close(devnull); | ||
| } | ||
| } | ||
| } | ||
| Role::Worker | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check declared targets, CI matrix, and cfg gating consistency.
fd -t f 'Cargo.toml' -H | xargs -r cat
fd -t f -e yml -e yaml . .github | xargs -r rg -n 'runs-on|target|matrix|windows'
rg -n 'cfg\(unix\)|cfg\(not\(unix\)\)|libc::' srcRepository: naoto256/amnestic-trace
Length of output: 3108
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## repository files"
git ls-files | sed -n '1,120p'
echo "## Cargo manifests"
fd -t f '^Cargo\.toml$' -H -x sh -c 'echo "--- $1"; sed -n "1,120p" "$1"' sh {}
echo "## CI / release workflow snippets"
fd -t f -e yml -e yaml . .github | while read -r f; do
echo "--- $f"
nl -ba "$f" | sed -n '1,150p'
done
echo "## relevant source snippets"
for f in src/detach.rs src/store.rs src/synthesize.rs src/recall.rs; do
if [ -f "$f" ]; then
echo "--- $f line count"
wc -l "$f"
echo "--- $f snippets"
nl -ba "$f" | sed -n '1,120p;260,425p;580,615p'
fi
done
echo "## exact cfg/extern/use context"
rg -n '#\(cfg|extern crate|use .*libc|libc::open|libc::fork|cfg_attr' Cargo.toml Cargo.lock srcRepository: naoto256/amnestic-trace
Length of output: 1444
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## CI / release workflow snippets"
for f in .github/workflows/ci.yml .github/workflows/release.yml; do
if [ -f "$f" ]; then
echo "--- $f"
cat -n "$f"
fi
done
echo "## relevant source snippets"
for f in src/detach.rs src/store.rs src/synthesize.rs src/recall.rs; do
if [ -f "$f" ]; then
echo "--- $f"
cat -n "$f"
fi
done
echo "## exact cfg/extern/use context"
rg -n '#\[cfg|cfg_attr|use .*libc|libc::open|libc::fork|libc::setsid|libc::dup2|extern crate' Cargo.toml Cargo.lock srcRepository: naoto256/amnestic-trace
Length of output: 50380
Gate src/detach.rs to #[cfg(unix)].
The release matrix only targets aarch64-apple-darwin and x86_64-unknown-linux-gnu, but the crate does not declare Unix-only support and CI builds without --target. detach() uses fork/session/process-fd APIs and a /dev/null path that do not compile on Windows; add a unix-only gate for this module or make the fork paths platform-specific with a not(unix) fallback.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/detach.rs` around lines 34 - 98, Gate the detach module and its
Unix-specific APIs behind #[cfg(unix)] so symbols such as log_stderr_to and
detach are not compiled on unsupported platforms. Ensure the crate still builds
on non-Unix targets by providing the appropriate existing or minimal not(unix)
fallback for any required public interface.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugin/README.md`:
- Around line 179-185: Update the prompt generation commands after amtr_root
selection to write amtr default-prompt output to a temporary file, then move it
to prompt.md only when generation succeeds; preserve the existing prompt file if
generation fails or is interrupted, and clean up the temporary file as
appropriate.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 09d6cde3-b2de-4c2c-add1-c848871e5de4
📒 Files selected for processing (11)
.github/workflows/ci.yml.github/workflows/release.ymlCargo.tomlplugin/README.mdplugin/skills/amtr/SKILL.mdplugin/tools/amtr-hook.shsrc/extract.rssrc/recall.rssrc/store.rssrc/synthesize.rstests/hook-regressions.sh
🚧 Files skipped from review as they are similar to previous changes (8)
- Cargo.toml
- plugin/skills/amtr/SKILL.md
- src/synthesize.rs
- plugin/tools/amtr-hook.sh
- tests/hook-regressions.sh
- src/store.rs
- src/extract.rs
- src/recall.rs
Summary
Summary by CodeRabbit
New Features
handoff,key,peek, and default-prompt commands for transferring, inspecting, and managing session memory.Documentation