Skip to content

Plan: Token daemon runtime directory and atomic writer (3.3.1) - #116

Draft
lodyai[bot] wants to merge 1 commit into
mainfrom
3-3-1-token-daemon-runtime-directory-and-writer
Draft

Plan: Token daemon runtime directory and atomic writer (3.3.1)#116
lodyai[bot] wants to merge 1 commit into
mainfrom
3-3-1-token-daemon-runtime-directory-and-writer

Conversation

@lodyai

@lodyai lodyai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Draft ExecPlan for roadmap item 3.3.1, introducing a host-side
    TokenWriter port and a cap_std-backed atomic writer that publishes
    $XDG_RUNTIME_DIR/podbot/<container_id>/ghapp_token (mode 0700/0600)
    via temp-file-plus-rename so concurrent readers never observe partial
    contents.
  • 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<'_> 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 in, preserves io::ErrorKind through error mapping,
    sweeps stale temp siblings on each write, and bans
    InstallationAccessToken::token outside the writer module via
    clippy::disallowed_methods.
  • Five-milestone delivery: M1 port and newtypes (red tests first), M2
    XDG resolution (mockable env injection where available), M3 cap-std
    atomic writer with mode discipline, redaction, and a 1-writer / 4-reader
    / 200-iteration stress test, M4 rstest-bdd behavioural coverage,
    M5 design doc, developers' guide, users' guide, and roadmap updates.
  • Incorporates Firecrawl prior-art research (XDG basedir spec, 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 per
the execplans skill's approval gate.

Test plan

  • User reviews the ExecPlan in
    docs/execplans/3-3-1-token-daemon-runtime-directory-and-writer.md and
    confirms scope, constraints, tolerances, risks, and milestone
    decomposition.
  • User confirms the design decisions in the Decision Log, especially
    the port returning RuntimeDir, the TokenMaterial<'_> boundary type,
    the synchronous port with spawn_blocking guidance, the
    allow_fallback = false default, and the bind-mount-the-directory rule
    to be promoted into docs/podbot-design.md.
  • After approval, implementation proceeds milestone by milestone
    within the documented tolerances, with make check-fmt, make lint,
    make test, make markdownlint, and make nixie plus
    coderabbit review --agent gating each commit.

References

🤖 Generated with Claude Code

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>

@sourcery-ai sourcery-ai 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.

Sorry @LodyAI[bot], you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 602c69a9-4f62-4ef2-b516-94d655e60724

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 3-3-1-token-daemon-runtime-directory-and-writer

Comment @coderabbitai help to get the list of available commands and usage tips.

@leynos leynos changed the title Draft execplan for token daemon runtime directory and atomic writer (3.3.1) Plan: Token daemon runtime directory and atomic writer (3.3.1) Jun 19, 2026
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.

1 participant