docs(forgejo-agent-operations): Keychain PAT + direct-curl pattern #214

Merged
pdurlej merged 1 commit from claude/orders/forgejo-agent-keychain-pattern into main 2026-05-12 01:31:53 +02:00
Collaborator

Canary status: missing — fire canary via python -m platformctl.tools.run_review before merge

Summary

Document how agents extract their actor-specific PAT on the operator's Mac without requiring an interactive bw unlock, plus the direct-curl + tempfile pattern as the canonical replacement for Forgejo MCP write actions.

Closes a documentation gap discovered 2026-05-12 night — an agent-souls session (issue #37) had to ask the operator to unlock Bitwarden interactively just to call a Forgejo write API as claude, while macOS Keychain already had the PAT pre-loaded the whole time.

Changes

docs/forgejo-agent-operations.md: new section Agent PATs On The Operator's Mac inserted between Identity Rules and Issue Rules, with two subsections:

  • macOS Keychain is the canonical local sourcesecurity find-internet-password extraction for claude, codex, glm under service git.pdurlej.com; identity-verification curl against /api/v1/user; explicit non-coverage rationale for iskra (VPS runtime / Infisical) and pdurlej (operator merge gate); Bitwarden fallback rule.
  • Direct-curl is the canonical write path — canonical tempfile + jq -n + curl -d @file POST pattern; identity check on response; same pattern applies to comment / PR / PATCH / review endpoints; PAT-non-paste rule.

Trailing sentence of Identity Rules now cross-references the new section.

Verification

Verified on the operator's Mac, 2026-05-12:

  • Keychain has accounts claude, codex, glm under service git.pdurlej.com; each returns a 40-character PAT via security find-internet-password -s git.pdurlej.com -a <actor> -w.
  • Each PAT against /api/v1/user resolves to the expected identity: login=claude id=3, login=codex id=4, login=glm id=5.
  • iskra and pdurlej are intentionally NOT in Keychain (confirmed).
  • This PR was opened using the documented direct-curl pattern (dogfood). The branch was pushed via git -c "http.extraheader=Authorization: token \$CLAUDE_PAT" using the claude Keychain PAT, no operator credentials touched.

Test plan

  • Operator readback: new section reads naturally between Identity Rules and Issue Rules
  • Operator confirms the Keychain extraction commands match the local Mac setup
  • (after merge) Next agent session attempting a Forgejo write as claude follows this section instead of asking for bw unlock

Tier (ADR-0007)

Lite. Diff = 66 additions, 1 deletion (LoC change = 67, ≤100). Single docs file. No schema, runtime, sacred-path, CI workflow, or ADR touched. No class/security-sensitive content (PAT extraction commands are documented; no PAT values appear in the diff or this PR body).

Note: tier/lite label does not yet exist on the repo (ADR-0007 still Proposed). Operator may add the label or proceed without — flagging here for visibility.

Spec sources read

  • docs/forgejo-agent-operations.md (existing, before edit)
  • practices/credential-management.md in pdurlej/agent-souls — canonical credential hierarchy, direct-curl > MCP rule, per-agent identity table; this PR is consistent with that doc and intentionally avoids duplicating its content beyond what platform-side agents need on-Mac
  • decisions/0007-risk-proportional-canary.md (tier classification, sensitive-paths list)
  • .forgejo/pull_request_template.md (PR shape)

Out of scope

  • No changes to practices/credential-management.md in agent-souls (different repo, different scope). That doc already covers the broader hierarchy; this PR adds the Mac-local Keychain shortcut and the canonical write-API pattern to the platform-facing operations doc only.
  • No new labels created. No CI workflow changes.
  • No PAT rotation or new PAT issuance.
Canary status: missing — fire canary via `python -m platformctl.tools.run_review` before merge ## Summary Document how agents extract their actor-specific PAT on the operator's Mac without requiring an interactive `bw unlock`, plus the direct-curl + tempfile pattern as the canonical replacement for Forgejo MCP write actions. Closes a documentation gap discovered 2026-05-12 night — an `agent-souls` session (issue #37) had to ask the operator to unlock Bitwarden interactively just to call a Forgejo write API as `claude`, while macOS Keychain already had the PAT pre-loaded the whole time. ## Changes `docs/forgejo-agent-operations.md`: new section **Agent PATs On The Operator's Mac** inserted between **Identity Rules** and **Issue Rules**, with two subsections: - **macOS Keychain is the canonical local source** — `security find-internet-password` extraction for `claude`, `codex`, `glm` under service `git.pdurlej.com`; identity-verification curl against `/api/v1/user`; explicit non-coverage rationale for `iskra` (VPS runtime / Infisical) and `pdurlej` (operator merge gate); Bitwarden fallback rule. - **Direct-curl is the canonical write path** — canonical tempfile + `jq -n` + `curl -d @file` POST pattern; identity check on response; same pattern applies to comment / PR / PATCH / review endpoints; PAT-non-paste rule. Trailing sentence of **Identity Rules** now cross-references the new section. ## Verification Verified on the operator's Mac, 2026-05-12: - Keychain has accounts `claude`, `codex`, `glm` under service `git.pdurlej.com`; each returns a 40-character PAT via `security find-internet-password -s git.pdurlej.com -a <actor> -w`. - Each PAT against `/api/v1/user` resolves to the expected identity: `login=claude id=3`, `login=codex id=4`, `login=glm id=5`. - `iskra` and `pdurlej` are intentionally NOT in Keychain (confirmed). - This PR was opened using the documented direct-curl pattern (dogfood). The branch was pushed via `git -c "http.extraheader=Authorization: token \$CLAUDE_PAT"` using the claude Keychain PAT, no operator credentials touched. ## Test plan - [ ] Operator readback: new section reads naturally between Identity Rules and Issue Rules - [ ] Operator confirms the Keychain extraction commands match the local Mac setup - [ ] (after merge) Next agent session attempting a Forgejo write as `claude` follows this section instead of asking for `bw unlock` ## Tier (ADR-0007) **Lite.** Diff = 66 additions, 1 deletion (LoC change = 67, ≤100). Single docs file. No schema, runtime, sacred-path, CI workflow, or ADR touched. No `class/security-sensitive` content (PAT extraction *commands* are documented; no PAT values appear in the diff or this PR body). Note: `tier/lite` label does not yet exist on the repo (ADR-0007 still **Proposed**). Operator may add the label or proceed without — flagging here for visibility. ## Spec sources read - `docs/forgejo-agent-operations.md` (existing, before edit) - `practices/credential-management.md` in `pdurlej/agent-souls` — canonical credential hierarchy, direct-curl > MCP rule, per-agent identity table; this PR is consistent with that doc and intentionally avoids duplicating its content beyond what platform-side agents need on-Mac - `decisions/0007-risk-proportional-canary.md` (tier classification, sensitive-paths list) - `.forgejo/pull_request_template.md` (PR shape) ## Out of scope - No changes to `practices/credential-management.md` in `agent-souls` (different repo, different scope). That doc already covers the broader hierarchy; this PR adds the Mac-local Keychain shortcut and the canonical write-API pattern to the platform-facing operations doc only. - No new labels created. No CI workflow changes. - No PAT rotation or new PAT issuance.
docs(forgejo-agent-operations): document Keychain PAT extraction + direct-curl write pattern
Some checks failed
canary-required / collect-diff (pull_request) Failing after 3s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 17s
python-ci / Python 3.11 (pull_request) Successful in 43s
python-ci / Python 3.12 (pull_request) Successful in 43s
python-ci / Python 3.13 (pull_request) Successful in 43s
canary-required / canary (pull_request) Has been skipped
545149cbbd
Closes documentation gap discovered 2026-05-12 when an agent-souls session
(issue #37) had to ask the operator to run `bw unlock` interactively just
to call a Forgejo write API as `claude`. The operator's macOS Keychain
already has cousin PATs pre-loaded for claude/codex/glm under service
`git.pdurlej.com`, extractable without a prompt via `security
find-internet-password`. Verified 2026-05-12: all three resolve to the
expected identity via `/api/v1/user`.

Also documents the tempfile + jq + curl -d @file pattern as the canonical
replacement for Forgejo MCP write actions, which authenticate as `pdurlej`
and silently violate per-agent identity isolation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/platform!214
No description provided.