Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
9d41cec
feat: setup agent policy, milestone loop, and review templates
kapustazh Sep 5, 2026
e37d721
feat: add .antigravity review configuration
kapustazh Sep 5, 2026
6ea00fd
Merge pull request #1 from SuPuHe/dev
kapustazh Sep 5, 2026
a304274
chore: establish OneShot agent workflow
SuPuHe Sep 6, 2026
b643206
chore: create 1 version of plan.md for the project
SuPuHe Sep 6, 2026
d295f8d
chore(agent): unify review workflow
kapustazh Sep 6, 2026
1048f16
docs: add .claude/CLAUDE.md pointing to repository policy
selezenart Sep 5, 2026
d9fac34
Merge pull request #3 from SuPuHe/feature/unified-agent-workflow
kapustazh Sep 6, 2026
982b705
Merge pull request #2 from SuPuHe/feature/claude-md-instructions
kapustazh Sep 6, 2026
fcc48d3
merge: reconcile agent workflows from develop
SuPuHe Sep 6, 2026
971e510
Merge pull request #5 from SuPuHe/agents-setup
SuPuHe Sep 6, 2026
87e413f
docs: expand independent three-coder milestone plan
SuPuHe Sep 6, 2026
a2a65fc
Merge remote-tracking branch 'origin/develop' into milestone/expand-p…
SuPuHe Sep 6, 2026
5ef6a66
Merge pull request #6 from SuPuHe/milestone/expand-product-plan
SuPuHe Sep 6, 2026
231ba5e
docs(plan): clarify product roadmap
kapustazh Sep 6, 2026
f641d97
docs(plan): replace estimates with diagrams
kapustazh Sep 6, 2026
47d289f
docs(plan): fix recovery diagrams
kapustazh Sep 6, 2026
4336e04
Merge pull request #7 from SWOFART/milestone/product-roadmap
kapustazh Sep 6, 2026
12603dd
docs(plan): define hashless recovery
kapustazh Sep 6, 2026
8b55623
docs(plan): finalize Arc Graph stack
kapustazh Sep 6, 2026
d256e53
Merge pull request #8 from SWOFART/milestone/product-roadmap
kapustazh Sep 6, 2026
722c2f0
docs(plan): clarify Subgraph MCP recovery flow
SuPuHe Sep 6, 2026
d8cb5d3
docs(plan): map sponsor claims and Arc qualification
selezenart Sep 6, 2026
d6758dd
fix(plan): resolve review blockers on Mermaid, Arc chain ID, and Grap…
kapustazh Sep 7, 2026
7a7571a
fix(plan): restore Subgraph MCP path
kapustazh Sep 7, 2026
9dc541d
Merge pull request #9 from SWOFART/plan-clarification
SuPuHe Sep 7, 2026
57aa5b0
ci: add stack lint workflow
kapustazh Sep 7, 2026
a1d8599
feat(arc-adapter): add Arc profiles, money, config, and readiness probe
selezenart Sep 7, 2026
3e37993
fix(ci): disable Chromium sandbox
kapustazh Sep 7, 2026
8be8d09
Merge pull request #10 from SWOFART/fix/stack-lint
kapustazh Sep 7, 2026
a5c4f23
feat(privy-adapter): verify Arc values and settle the Memo policy spike
selezenart Sep 7, 2026
9773646
feat(testkit-settlement): add offline RPC simulator for readiness sce…
selezenart Sep 7, 2026
da273cb
docs(research): wrap bare source URLs for markdownlint
selezenart Sep 7, 2026
798f00e
Merge remote-tracking branch 'origin/develop' into milestone/b01-sdk-…
selezenart Sep 7, 2026
031b119
feat(settlement): add canonical request, policy fixture, receipt, and…
selezenart Sep 7, 2026
e9e9503
feat(contracts): establish A01 foundation
kapustazh Sep 7, 2026
c3ab0ca
Merge pull request #13 from SWOFART/milestone/a01-foundation-contracts
kapustazh Sep 7, 2026
e6a15ee
feat(testkit): add offline settlement harness and fixture capture
selezenart Sep 7, 2026
f1e971b
feat(reconciliation): add C01 recovery evidence contract
SuPuHe Sep 7, 2026
b6fcd25
fix(b03): address both blocking review findings
selezenart Sep 7, 2026
a2af79c
Merge pull request #16 from SWOFART/milestone/c01-recovery-evidence-s…
SuPuHe Sep 7, 2026
d7f0132
feat(adapter): add failure taxonomy, evidence lookup, drift hardening…
selezenart Sep 7, 2026
3e78812
feat(ledger): durable PostgreSQL intents, migrations, and API boundar…
kapustazh Sep 7, 2026
64d0a6f
Merge pull request #15 from SWOFART/milestone/a02-durable-intents
kapustazh Sep 7, 2026
154d8cc
refactor(evidence): drop unused nonce field from PersistedIdentity
selezenart Sep 7, 2026
a06018d
feat(worker): atomic at-most-once settlement worker (A03)
kapustazh Sep 7, 2026
7eb82d5
fix(worker): sequential outbox draining and serial client queries
kapustazh Sep 7, 2026
0d02c74
feat(composition): restart safety, operations, telemetry, and simulat…
kapustazh Sep 7, 2026
12a5d7f
Merge pull request #11 from SWOFART/milestone/b01-sdk-network-compati…
selezenart Sep 7, 2026
99fe277
Merge pull request #18 from SWOFART/milestone/a03-atomic-worker
selezenart Sep 7, 2026
45cf288
feat(api): add executable server runtime
kapustazh Sep 7, 2026
656a8a0
Merge remote-tracking branch 'origin/develop' into milestone/a04-rest…
kapustazh Sep 7, 2026
2144026
ci: isolate standalone settlement packages
kapustazh Sep 7, 2026
7b78326
Merge pull request #19 from SWOFART/milestone/a04-restart-operations-…
kapustazh Sep 7, 2026
5ad02a1
merge: integrate B lane into the pnpm workspace
selezenart Sep 7, 2026
33d98b5
ci: drop the separate npm job for the settlement packages
selezenart Sep 7, 2026
c96aa9b
Merge pull request #24 from SWOFART/milestone/b-lane-integration
SuPuHe Sep 7, 2026
fecbfda
feat(reconciliation): LLM recovery agent contract and deterministic s…
kapustazh Sep 7, 2026
c323c63
feat(reconciliation): cross-source failure injection, chaos timeline …
kapustazh Sep 7, 2026
c9cb3f4
feat(reconciliation): harden C02 C03 recovery safety
SuPuHe Sep 7, 2026
98d1fb7
Merge pull request #22 from SWOFART/milestone/c02-c03-hardening
SuPuHe Sep 7, 2026
72f643d
feat(adapter): add P4 composition adapters and compile-time port conf…
selezenart Sep 7, 2026
c77e9a4
feat(web): add deployment placeholder
kapustazh Sep 7, 2026
621f1e6
Merge pull request #25 from SWOFART/fix/cloudflare-placeholder
kapustazh Sep 7, 2026
93fe9f9
fix(adapter): validate the Transfer log index before confirming
selezenart Sep 7, 2026
e6dd98f
Merge remote-tracking branch 'origin/develop' into milestone/b-p4-ada…
selezenart Sep 7, 2026
5da6e05
fix(deploy): route production domain
kapustazh Sep 7, 2026
70b9e3a
Merge pull request #26 from SWOFART/fix/cloudflare-custom-domain
kapustazh Sep 7, 2026
25bf1e6
Merge remote-tracking branch 'origin/develop' into milestone/b-p4-ada…
selezenart Sep 7, 2026
62d7ea7
docs: correct the lane B package names in the P4 composition docs
selezenart Sep 7, 2026
4295bd9
Merge pull request #27 from SWOFART/milestone/b-p4-adapters
selezenart Sep 7, 2026
b6e4609
docs: add the public repository README
selezenart Sep 7, 2026
6f332f8
feat(reconciliation): recovery matrix and simulator composition (C04)
kapustazh Sep 7, 2026
50d8e7b
Merge pull request #29 from SWOFART/milestone/c04-recovery-matrix-int…
kapustazh Sep 7, 2026
5d49d27
Merge pull request #28 from SWOFART/feature/root-readme
selezenart Sep 8, 2026
be92593
feat(worker): Gate P4 backend convergence and adapter replacement
kapustazh Sep 8, 2026
01ec3db
fix(worker): add missing project references to worker tsconfig and ro…
kapustazh Sep 8, 2026
25a17d8
Merge pull request #30 from SWOFART/milestone/gate-p4-convergence
kapustazh Sep 8, 2026
cf0b79b
feat(recovery-ui): add frontend recovery timeline
SuPuHe Sep 8, 2026
1250dec
Merge pull request #31 from SWOFART/milestone/c05-frontend-recovery
SuPuHe Sep 8, 2026
fe54774
feat(graph): add live Arc USDC subgraph
kapustazh Sep 8, 2026
41399ad
feat(recovery): add C06 qualification demo bundle
SuPuHe Sep 8, 2026
d3fbfac
feat(web): frontend intent and authoritative status (A05)
kapustazh Sep 8, 2026
4ce750f
merge: add live Arc subgraph source to C06
SuPuHe Sep 8, 2026
b164062
fix(deploy): configure web build in wrangler for workers builds
kapustazh Sep 8, 2026
70f984f
docs(context): record Gate A verdict and fix bare URL in A05 context
kapustazh Sep 8, 2026
493e5cd
ci: retry cloudflare workers build
kapustazh Sep 8, 2026
599a6ec
fix(deploy): integrate subgraph and Cloudflare build
SuPuHe Sep 8, 2026
4afd709
Merge pull request #32 from SWOFART/milestone/a05-frontend-intent-status
kapustazh Sep 8, 2026
af13686
fix(graph): generate types before subgraph build
SuPuHe Sep 8, 2026
68c847c
Merge remote-tracking branch 'origin/develop' into milestone/c06-qual…
SuPuHe Sep 8, 2026
89eaea3
style: format merged frontend configuration
SuPuHe Sep 8, 2026
0ce3a89
feat(contracts): freeze frontend boundary with B05 fields, mock serve…
kapustazh Sep 8, 2026
8f3249a
Merge pull request #34 from SWOFART/milestone/gate-p4-frontend-freeze
kapustazh Sep 8, 2026
fcf382d
Merge pull request #33 from SWOFART/milestone/c06-qualification-demo
SuPuHe Sep 8, 2026
36df8fa
fix(deploy): switch to previous front
SuPuHe Sep 8, 2026
b36f53a
feat(ops): add A06 release bundle
kapustazh Sep 8, 2026
935a441
chore: merge develop into A06
kapustazh Sep 8, 2026
a3c8f75
fix(ops): fail closed on schema digest mismatch in db bootstrap
kapustazh Sep 8, 2026
710614a
Merge pull request #35 from SWOFART/milestone/a06-release-operations
kapustazh Sep 8, 2026
2fbc8bd
feat(settlement-ui): add B05 authorization and settlement details slice
selezenart Sep 8, 2026
9364515
feat(web): serve recovery UI under /recovery
SuPuHe Sep 8, 2026
00bd8fa
Merge pull request #37 from SWOFART/feature/recovery-route-composition
SuPuHe Sep 8, 2026
735b01d
docs(settlement): record live Arc settlement, policy denials and reco…
kapustazh Sep 8, 2026
9ac2d16
Merge remote-tracking branch 'origin/develop' into feat/cloud-deployment
kapustazh Sep 8, 2026
8330a17
style(docs): resolve markdownlint and EOF whitespace errors
kapustazh Sep 8, 2026
7f4ad07
Merge pull request #38 from SWOFART/feat/cloud-deployment
kapustazh Sep 8, 2026
ea97294
fix: stabilize generated contract formatting
SuPuHe Sep 8, 2026
0c027c6
docs: align live integration evidence
SuPuHe Sep 8, 2026
1697c87
chore: enforce lf text checkouts
SuPuHe Sep 8, 2026
1b3664e
fix(settlement-ui): pin explorer hosts and select attempts by timestamp
selezenart Sep 8, 2026
0291b68
Merge pull request #39 from SWOFART/fix/repository-health-and-docs
SuPuHe Sep 8, 2026
1eeb22c
docs: audit remaining plan work
SuPuHe Sep 8, 2026
5f845c8
Merge pull request #36 from SWOFART/milestone/b05-frontend-settlement…
selezenart Sep 8, 2026
83e082b
Merge pull request #40 from SWOFART/docs/missing-plan-implementation
SuPuHe Sep 8, 2026
310daf1
feat(testkit-settlement): add B06 sponsor evidence bundle
selezenart Sep 8, 2026
8ea308b
fix(testkit-settlement): close B06 review findings
selezenart Sep 8, 2026
48391e4
Merge pull request #41 from SWOFART/milestone/b06-sponsor-evidence
SuPuHe Sep 8, 2026
c8cd26f
docs: correct Gate P4 verification status
kapustazh Sep 8, 2026
043160c
fix(settlement): close lane B review follow-ups
selezenart Sep 8, 2026
8ed6096
fix: require recovery lookup config
kapustazh Sep 8, 2026
510421b
docs: update plan with Graph deployment status
SuPuHe Sep 8, 2026
bb59db4
Merge pull request #42 from SWOFART/fix/p4-verification-status
kapustazh Sep 8, 2026
b352d9a
Merge pull request #43 from SWOFART/fix/lane-b-review-followups
kapustazh Sep 8, 2026
97e56b5
Merge pull request #44 from SWOFART/fix/production-recovery-config
kapustazh Sep 8, 2026
1e812d4
feat(reconciliation): implement live Vertex AI recovery advisor and S…
kapustazh Sep 8, 2026
bfff767
Merge pull request #46 from SWOFART/feat/vertex-ai-recovery-advisor
kapustazh Sep 8, 2026
0cd80ca
Merge pull request #45 from SWOFART/docs/update-plan-subgraph
SuPuHe Sep 9, 2026
44c680b
docs: record PR 46 recovery adapter progress
SuPuHe Sep 9, 2026
d40af37
Merge pull request #47 from SWOFART/docs/update-plan-pr46
SuPuHe Sep 9, 2026
4f56379
feat(graph): complete live Subgraph MCP recovery proof and qualify Th…
kapustazh Sep 9, 2026
a92e9ef
feat(reconciliation): qualify the graph via live studio subgraph and …
kapustazh Sep 9, 2026
49306b4
fix(subgraph): remove trailing empty line in schema.graphql
kapustazh Sep 9, 2026
7cb629c
Merge pull request #48 from SWOFART/feat/graph-sponsor-qualification
kapustazh Sep 9, 2026
3c31393
docs: plan Arc Circle qualification path
SuPuHe Sep 9, 2026
779c6cf
Merge pull request #49 from SWOFART/docs/arc-circle-qualification-plan
selezenart Sep 9, 2026
f1cba90
feat(web): compose P5 frontend acceptance
SuPuHe Sep 9, 2026
f836b9a
feat(web): merge P5 frontend acceptance implementations
SuPuHe Sep 9, 2026
ded0655
merge: sync P5 comparison branch with develop
SuPuHe Sep 9, 2026
c38511c
Merge pull request #52 from SWOFART/feature/p5-compare-pr50
SuPuHe Sep 9, 2026
3b23a3c
feat(worker): add production runtime
SuPuHe Sep 9, 2026
da65a16
test(worker): wire integration ledger dependencies
SuPuHe Sep 9, 2026
99d2f47
fix: use pnpm version
SuPuHe Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
120 changes: 120 additions & 0 deletions .agent/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# OneShot Agent Policy

This policy applies to code, documentation, infrastructure, data, and agent
work in this repository.

## Instruction order

1. Follow system and user instructions.
2. Follow root `AGENTS.md` and this policy.
3. Follow the task-specific documents and repo skills routed by root
`AGENTS.md`.
4. Follow the narrowest applicable repository configuration.

Surface conflicts. Never silently weaken an invariant, review gate, or security
boundary.

## Tool neutrality

- Codex, Claude, Antigravity, Cursor, or another capable agent may implement
work, but all tools follow the same canonical repository policy.
- Tool adapters remain short pointers to root `AGENTS.md`; personal prompts,
permissions, models, and machine-specific commands stay in ignored files.
- Gate A and Gate B use separate fresh, read-only FreePi processes. Each verdict
records the reviewer tool, platform-reported model (or `not exposed by
platform`), and immutable Git identities required by
`.agent/IMPLEMENTATION_LOOP.md`.

## Product boundary

OneShot's core promise is: `One job. Many retries. One settlement.`

- OneShot owns authoritative Business Intent, Attempt, and Settlement state and
prevents duplicate committed settlements.
- Privy provides corporate wallet access and scoped authorization, policy, and
spending permissions.
- Arc is the USDC settlement rail.
- Direct Privy and Arc evidence resolves known transaction identities. The Graph
is the selected v1 hashless candidate-discovery layer after its C01 evidence
gate; it is never the duplicate-payment lock or settlement authority.

Read `.agent/PROJECT_CONTEXT.md`, `.agent/SECURITY_INVARIANTS.md`, and
`.agent/SPONSOR_REQUIREMENTS.md` before changing these boundaries.

## Non-negotiable invariants

- `1 business intent -> at most 1 committed settlement`.
- Keep one stable `business_intent_id` across retries, restarts, parallel
attempts, workers, and agent instances.
- Treat `UNKNOWN` settlement state as a reconciliation requirement. Never
blindly repay.
- Make state durable and transitions atomic and concurrency-safe.
- Represent money as integer atomic units or `bigint`, never JavaScript
floating point.
- External-index absence or delay is not proof that payment did not happen.
- Normal execution must not bypass Privy policy or OneShot controls.
- Use testnet only unless the user explicitly authorizes another network.
- Never log, expose, persist, commit, or send secrets, private keys, seed
phrases, tokens, wallet credentials, or sensitive runtime configuration.

## Before changing files

- Inspect the current branch, status, task acceptance criteria, relevant code,
existing diff, and any merge/rebase state.
- Preserve unrelated user work and keep it out of commits.
- Record material assumptions and active context in `.agent/context/`.
- Use current primary documentation for version-sensitive integrations.
- Do not create or materially revise the product implementation `plan.md` until
required skills and integration research are ready.

## Implementation quality

- Keep one branch and PR focused on one milestone or tightly related change.
- Preserve clear ownership among interface, orchestration, domain state, and
external adapters.
- Validate untrusted input at boundaries.
- Do not weaken compiler, lint, type, test, or security settings to get a pass.
- Add tests for behavior changes and regression fixes. Payment-related changes
select applicable cases from `.agent/TEST_MATRIX.md`.
- Do not leave dead code, unexplained suppressions, placeholder credentials, or
hidden follow-up work.
- Update documentation when behavior, contracts, or architecture change.

## Repository skills

- `oneshot-idempotency`: mandatory for intent, retry, worker, payment,
reconciliation, or settlement work.
- `oneshot-failure-injection`: mandatory for external-effect failure
boundaries.
- `sponsor-qualification`: mandatory before sponsor, demo, or release claims.

Personal workflow and review skills may supplement these rules. They never
replace OneShot policy or FreePi Gate A/B.

## Git and review policy

- Never implement directly on `main` or `develop`.
- Branch from current `develop`; target `develop` from short-lived
`feature/*`, `fix/*`, or `milestone/*` branches unless the user explicitly
names another short-lived branch.
- Never direct-push or force-push protected branches or rewrite shared history
without explicit user authorization.
- Follow `.agent/IMPLEMENTATION_LOOP.md` for local checks, staged-tree identity,
both independent FreePi reviews, CI, PR readiness, and invalidation rules.
- Only explicit `VERDICT: PASS` passes a gate. Missing, ambiguous, truncated,
stale, unauthenticated, or failed review output fails closed.
- Agents never merge a PR. A human reviews and explicitly authorizes the merge.

## Context retention

Follow `.agent/context/README.md`. Update the active record at milestone
boundaries, before handoff/session end, and before deliberate context reset or
compaction when possible. Never store secrets there.

## Agent-complete

Handoff only after intended scope is complete, local checks pass, the diff is
cleanly scoped, and current gate state is recorded. A change is ready for human
review only after Gate A, required CI, and Gate B pass for the exact applicable
tree/head. Report branch, commit, PR, checks, gate evidence, and remaining
risks. Never merge.
144 changes: 144 additions & 0 deletions .agent/IMPLEMENTATION_LOOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# OneShot Implementation Loop

This is the required path from a focused change to human review. `develop` is
the base. Gate A binds to one immutable candidate tree before the first push;
Gate B binds to the exact draft-PR head SHA and the same tree after required CI.

## 1. Scope and branch

1. Start from current `develop`.
2. Create one short-lived `feature/*`, `fix/*`, or `milestone/*` branch unless
the user explicitly names another short-lived branch.
3. Record goal, acceptance criteria, assumptions, non-goals, and branch state in
`.agent/context/`.
4. Never implement directly on `develop` or `main`.

## 2. Implement and validate

1. Make the smallest coherent change.
2. Use applicable repo skills and `.agent/TEST_MATRIX.md`.
3. Run local format, lint, type, test, build, and focused failure-injection
checks that exist for affected components.
4. Inspect tracked, staged, unstaged, ignored, and intended untracked changes
for scope, generated files, secrets, and unrelated work. Never open or send
ignored secret files to a reviewer.
5. Stage every intended file and only intended files. Gate A reviews a single
candidate tree, not a partially staged workspace.
6. Record concise command/result evidence in the active context. Keep full logs
only for failures that require diagnosis.

Do not bypass failures with force flags, skipped checks, broad ignores, lower
thresholds, or disabled hooks.

## 3. Capture immutable Gate A evidence

Refresh the base and record exact identities:

```bash
git fetch origin develop
git rev-parse origin/develop
git write-tree
git status --short
git diff --cached --check
git diff --cached <recorded-base-sha>
```

- `recorded-base-sha` is the printed full SHA, not a moving ref.
- `git write-tree` is the candidate tree SHA.
- For an already-created but unpushed merge commit, use
`git rev-parse "HEAD^{tree}"` and `git diff <recorded-base-sha> HEAD`; the
commit must have no additional workspace changes.
- Confirm no intended change is absent from the candidate and no unrelated file
is present.

## 4. FreePi Gate A: pre-push review

1. From the repository root, start exactly one fresh process:

```bash
npx free-pi-cli
```

2. In one message, tell the new session to read
`.agent/review-prompts/freepi-prepush-review.md`; provide only the task
acceptance criteria, recorded base SHA, candidate tree SHA, and whether the
tree is staged or the exact unpushed `HEAD` tree.
3. Let the reviewer inspect the candidate diff and routed repository documents
with its tools. Do not paste duplicate policy, complete file bodies, repeated
terminal output, or secrets into the prompt.
4. Accept only an explicit `VERDICT: PASS` containing the required reviewer,
model, base, target, and tree identities.

Each attempt uses a new `npx free-pi-cli` process. Never resume or reuse a
reviewer context. Any candidate-tree change invalidates Gate A and requires
local checks plus a new process. Missing evidence, ambiguity, truncation,
authentication/tool failure, or any verdict other than explicit PASS fails
closed.

## 5. Commit, push, and draft PR

Only after Gate A passes for the candidate tree:

1. If the tree is staged, commit it without changing content. If Gate A reviewed
an existing unpushed commit, do not amend it.
2. Confirm `git rev-parse "HEAD^{tree}"` equals the reviewed candidate tree.
3. Push the short-lived branch without force.
4. Create a draft PR targeting `develop`, never `main` for feature work.
5. Fill `.github/PULL_REQUEST_TEMPLATE.md`, including Gate A evidence.

## 6. Required CI

Wait for every required check on the exact draft-PR head SHA. Pending, skipped,
missing, or failing required checks are not green.

If a fix changes content, rerun local validation and fresh Gate A, commit, push,
and wait for CI again.

## 7. FreePi Gate B: exact PR review

1. Capture PR URL/number, base, head branch, exact full head SHA, head tree SHA,
full diff, required check results, and Gate A candidate tree.
2. Start a second fresh process from the repository root:

```bash
npx free-pi-cli
```

3. In one message, tell it to read
`.agent/review-prompts/freepi-pr-review.md` and provide only the captured
identities, PR URL, concise CI summary, acceptance criteria, and Gate A
verdict. Let the reviewer obtain the diff and public evidence with tools.
4. Accept only explicit `VERDICT: PASS` bound to the exact current PR head SHA
whose tree equals the Gate A candidate tree.

Any content change after Gate B invalidates both tree equality and Gate B.
Return to local validation, fresh Gate A, commit/push, green CI, then fresh Gate
B.

## 8. Human review and merge

After Gate A, required CI, and Gate B pass for the current tree/head:

1. Record both verdicts and evidence in the PR and context file.
2. Mark the draft ready for human review.
3. Report branch, SHA, tree SHA, PR URL, checks, gates, and residual risks.
4. Stop. Agents never merge; only a human may authorize and perform the merge.

## Review token discipline

- Canonical policy is linked, not copied into tool adapters or review prompts.
- Send each reviewer one compact instruction message. The reviewer reads only
documents routed by root `AGENTS.md` and files relevant to the diff.
- Reference immutable Git identities and concise check results instead of
pasting whole diffs, policy files, or successful logs into chat.
- Reviewers inspect silently and return one structured verdict. They do not
narrate file reads, repeat the task, or restate unchanged policy.
- Never reduce scope, skip evidence, or hide failures to save tokens. Token
discipline removes duplication, not review coverage.

## Privacy boundary

FreePi may review the candidate diff, tests, public documentation, and
non-sensitive check evidence only. Never provide `.env*`, ignored files,
private keys, seed phrases, access tokens, API secrets, wallet credentials, or
sensitive runtime configuration. If safe review is impossible, fail the gate.
87 changes: 87 additions & 0 deletions .agent/PROJECT_CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# OneShot Project Context

## Product statement

`One job. Many retries. One settlement.`

OneShot executes an approved business obligation safely despite retries,
crashes, lost responses, parallel workers, or multiple agent instances.

The core cardinality is:

`1 intent / N attempts / <=1 committed settlement`

This document defines ownership and vocabulary. It is not a product
implementation plan.

## Primary production vertical

The first user is a company that lets an autonomous agent purchase a paid API
operation or digital result in USDC. The company approves one business
obligation; retries, restarts, queue redelivery, parallel workers, and multiple
agent instances must all converge on the same Business Intent and at most one
committed settlement.

The initial product exposes an agent API, execution worker, reconciliation
service, operator console, and audit/recovery timeline. Invoice payment,
procurement, subscriptions, and other agent-commerce workflows are later
verticals over the same durable intent contract.

## System ownership

- OneShot is authoritative for business-intent execution state, attempt state,
settlement state, and permission to create another external settlement.
- Privy is the corporate wallet and scoped authorization boundary. OneShot must
use its policies and spending permissions on the normal execution path.
- Arc is the real USDC settlement rail used by the demo.
- Direct Privy lookup and Arc RPC receipt/log evidence resolve known transaction
identities after ambiguous outcomes.
- The Graph is the selected v1 candidate-discovery layer when the transaction
hash is missing. C01 must prove live hashless discovery and AI-track value;
Graph results remain non-authoritative and can never authorize another payment.

When an external submission may have happened but the result is uncertain,
OneShot records `UNKNOWN` and reconciles. Missing external-index data never converts `UNKNOWN` into permission to submit again.

## Glossary

### Business Intent

The durable identity of one approved business obligation. Its
`business_intent_id` remains stable across retries, process restarts, queue
redelivery, parallel workers, and multiple agents. Payload differences do not
create a second settlement right when the identifier is the same.

### Attempt

One execution try for a Business Intent. Attempts are expendable and may fail or
repeat. Any number of Attempts can belong to one Business Intent.

### Settlement

The committed external USDC payment for a Business Intent. A Business Intent may
have zero or one committed Settlement, never more than one.

### Reconciliation

The process that resolves an ambiguous external effect using durable local
state, provider identifiers and receipts, Graph-discovered candidates, and Arc proof.
Reconciliation precedes any decision to retry payment when settlement state is
`UNKNOWN`.

### Recovery View

A derived, non-authoritative view assembled from durable OneShot records, live
Graph candidate discovery, and Arc verification. It helps operators and agents explain
and recover work but does not grant permission to create a Settlement.

## Decision test

Any design affecting retries or payments must answer:

1. What stable Business Intent does this Attempt belong to?
2. Which durable atomic transition grants the right to submit an external
Settlement?
3. How is an ambiguous submission reconciled without a blind retry?
4. How do parallel workers converge on at most one committed Settlement?
5. Which evidence is authoritative, and which evidence is only a Recovery View?
Loading
Loading