Plan: Token daemon runtime directory and atomic writer (3.3.1) - #116
Draft
lodyai[bot] wants to merge 1 commit into
Draft
Plan: Token daemon runtime directory and atomic writer (3.3.1)#116lodyai[bot] wants to merge 1 commit into
lodyai[bot] wants to merge 1 commit into
Conversation
Capture the design, constraints, tolerances, risks, milestones, and acceptance criteria for the host-side TokenWriter port and the `cap_std`-backed atomic writer adapter that publishes a per-container `ghapp_token` at `$XDG_RUNTIME_DIR/podbot/<container_id>/` with mode 0700/0600. The plan returns `RuntimeDir` from the port (encoding the bind-mount-the-directory rule at the type level so 3.4.1 cannot pin a file dentry), introduces a domain-owned `TokenMaterial<'_>` byte wrapper so the port does not depend on `crate::github`, defaults `RuntimeDirPolicy::allow_fallback` to `false`, prefers `$XDG_STATE_HOME/podbot/runtime/` ahead of `/tmp/podbot-<uid>` when fallback is opted into, preserves `io::ErrorKind` through error mapping, sweeps stale temp files on each write, and enforces no token leakage via a `clippy::disallowed_methods` rule on `InstallationAccessToken::token`. Incorporates Firecrawl prior-art research (XDG basedir spec, rename(2) atomicity, cap-std API, file-bind-mount dentry footgun), a Plan-agent architectural pass, and a full Logisphere community-of-experts design review covering structural integrity, alternatives, scaling, contract evolution, failure modes, and long-term viability. Status: DRAFT, awaiting user approval before implementation begins. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Summary
TokenWriterport and acap_std-backed atomic writer that publishes$XDG_RUNTIME_DIR/podbot/<container_id>/ghapp_token(mode0700/0600)via temp-file-plus-rename so concurrent readers never observe partial
contents.
RuntimeDirfrom the port (encoding thebind-mount-the-directory rule at the type level so 3.4.1 cannot pin a
file dentry), introduces a domain-owned
TokenMaterial<'_>wrapper sothe port does not depend on
crate::github, defaultsRuntimeDirPolicy::allow_fallbacktofalse, prefers$XDG_STATE_HOME/podbot/runtime/ahead of/tmp/podbot-<uid>whenfallback is opted in, preserves
io::ErrorKindthrough error mapping,sweeps stale temp siblings on each write, and bans
InstallationAccessToken::tokenoutside the writer module viaclippy::disallowed_methods.XDG resolution (
mockableenv injection where available), M3 cap-stdatomic writer with mode discipline, redaction, and a 1-writer / 4-reader
/ 200-iteration stress test, M4
rstest-bddbehavioural coverage,M5 design doc, developers' guide, users' guide, and roadmap updates.
rename(2)atomicity, cap-std API, the Linux file-bind-mount dentry footgun), a
Plan-agent architectural pass, and a full Logisphere
community-of-experts design review (Pandalump structural integrity,
Wafflecat alternatives, Buzzy Bee scaling, Telefono contracts,
Doggylump failure modes, Dinolump long-term viability) with a
structured pre-mortem.
The ExecPlan is
docs/execplans/3-3-1-token-daemon-runtime-directory-and-writer.md.Status is
DRAFT; implementation is gated on explicit user approval perthe execplans skill's approval gate.
Test plan
docs/execplans/3-3-1-token-daemon-runtime-directory-and-writer.mdandconfirms scope, constraints, tolerances, risks, and milestone
decomposition.
the port returning
RuntimeDir, theTokenMaterial<'_>boundary type,the synchronous port with
spawn_blockingguidance, theallow_fallback = falsedefault, and the bind-mount-the-directory ruleto be promoted into
docs/podbot-design.md.within the documented tolerances, with
make check-fmt,make lint,make test,make markdownlint, andmake nixiepluscoderabbit review --agentgating each commit.References
🤖 Generated with Claude Code