docs: record the push-receipt attempt against production 496dcdf

b1f3cc17a30a · AtlantisPleb · · parent edec7225b8ad

docs: record the push-receipt attempt against production 496dcdf

The three Box fixes are live. This records what they unblocked — the
conversation bootstrap, `opencode` on the run PATH, and a credentialed
dispatch that actually executes — and the defect they exposed underneath.

The push is refused with `401` on both `git-receive-pack` and
`git-upload-pack`, which places it in `ForgeGitAuth` before branch policy.
`Assignments.persist_assignment/7` embeds the assignment id in the token, but
`authenticate/1` looks the credential up by the credential's own primary key,
which is separately autogenerated. That row never exists, so no assignment
credential can authenticate. Deterministic, and unnoticed because the only
tests of `authenticate/1` cover invalid tokens and no test ever held a real
plaintext.

Criterion (c) of openagents.com#255 remains unmet, with the remaining work
now one query wide.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SoZMfWRSGnf6FZX2Ar9rQ2
Co-Authored-By
Claude Fable 5 <noreply@anthropic.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

pushed
by user · WAL seq 422 · 2026-08-25T22:35:29.448272Z
built
2 modules in 143.8 s
deployed
live · 2 modules on 3 nodes · push→live —
deployed
needs_rolling_replace · 2 modules on 0 nodes · push→live —

Changed files

  • modified docs/2026-08-25-ox-alpha-stress-test-log.md

Diff

1 file changed, +104 -0

docs/2026-08-25-ox-alpha-stress-test-log.md modified +104

@@ -353,3 +353,107 @@ credential, which `Forge.Assignments.create/1` mints server-side and never

353 353
returns to an API caller, so it cannot be exercised until this change is
354 354
deployed. Every step before the authenticated git handshake is demonstrated
355 355
live above.
356
357
## 9. Push-receipt attempt against production `496dcdf` (2026-08-25)
358
359
The three fixes in §8 are deployed. This section records what they unblocked,
360
and the next defect they exposed, which still blocks criterion (c) of
361
openagents.com#255. Box `bx_9wxjdrkq`, conversation `3dd6d813`, stopped
362
afterwards; peak concurrency 1.
363
364
### What now works
365
366
`GET /api/v1/conversation` answers `200` for a `box:control`-only token and
367
returns `3dd6d813-97dd-496d-b3a2-7ea59c47cd2c`. The bootstrap that had no
368
route is a single call.
369
370
A freshly provisioned box reports `setup_status: done`, and
371
`sh -c 'command -v opencode && opencode --version'` answers
372
`/home/user/.local/bin/opencode` and `1.18.23`, with that path a symlink to
373
`/home/user/.opencode/bin/opencode` and `opencode.json` pointing at
374
`openrouter/stealth/ox-alpha`. The install and the PATH defects are closed in
375
production, not just in a rehearsal.
376
377
**The credentialed dispatch works.** Assignment
378
`6556f2de-98ad-4a19-b5b6-381f50d83bf7` reached `state: running` with
379
`started_at` set, and its run `318ca446-54a2-4787-992f-a18e0b5c5d12` recorded
380
`dispatched_at` and ran to `exit_status: 128`. Before §8 this failed at
381
dispatch with `box_response_invalid`, no pid, and no run root. The run got as
382
far as cloning the repository, creating the branch, and writing commit
383
`e5a157c`. `box_runs.command` holds the caller's script and carries no
384
credential, as designed.
385
386
### What still fails, and why
387
388
The push is refused:
389
390
```
391
fatal: Authentication failed for 'https://openagents.com/OpenAgentsInc/openagents.com.git/'
392
```
393
394
This is not the dispatch defect and not branch policy. A second assignment
395
(`6ac74171-2ff0-4688-adb2-4cf97af1a1d2`, run
396
`17e308d3-d9f4-44a7-8bd0-b1a57bd46c76`, exit 0) inspected the live run
397
environment instead of pushing:
398
399
- the credential file exists at mode `0600`, and the run's `gitconfig` names it
400
  as `credential.helper`
401
- the token is intact: 94 bytes, prefix `oa_assignment_`, which is the exact
402
  shape `persist_assignment/7` mints
403
- `git-receive-pack` returns **401**
404
- `git-upload-pack` returns **401**, on a public repository that clones
405
  anonymously in the same run
406
407
Both verbs failing with `401` places the refusal in
408
`OpenAgentsWeb.Plugs.ForgeGitAuth`, before any branch or repository policy
409
runs. Presenting the credential turns an anonymous read that succeeds into an
410
authenticated read that fails.
411
412
The cause is an identifier mismatch in
413
`OpenAgents.Forge.Assignments`. `persist_assignment/7` generates one UUID, uses
414
it as the **assignment's** primary key, and embeds it in the token:
415
416
```elixir
417
id = Ecto.UUID.generate()
418
plaintext = @prefix <> id <> "." <> secret
419
```
420
421
The credential row is then inserted with no explicit id. Its schema declares
422
`@primary_key {:id, :binary_id, autogenerate: true}` and its changeset never
423
casts `:id`, so the row takes a different, random primary key and is linked
424
only by `assignment_id`. But `authenticate/1` reads the uuid out of the token
425
and looks the credential up by **its own** primary key:
426
427
```elixir
428
Repo.one(from c in AssignmentCredential, where: c.id == ^uuid, ...)
429
```
430
431
That row cannot exist. Every assignment credential fails authentication, every
432
time — this is deterministic, not a race or a timing window.
433
434
`Assignments.credential/1` queries `where: c.assignment_id == ^id`, so the rest
435
of the module already treats `assignment_id` as the link. `authenticate/1` is
436
the one place that does not.
437
438
### Why this was not caught
439
440
Both existing tests of `authenticate/1` assert only that an *invalid* token is
441
refused. Every test that reaches `Assignments.create/1` wraps it in a `try`
442
that tolerates the run failing to start, so none of them ever holds a real
443
plaintext credential. Mint-then-present had no coverage anywhere.
444
445
A reproduction is in
446
`test/openagents/forge/assignment_credential_auth_test.exs`. It creates a real
447
assignment, and three race-free assertions pass before the failure: the token's
448
uuid equals the assignment id, `Repo.get(AssignmentCredential, token_uuid)` is
449
`nil`, and `Repo.get_by(AssignmentCredential, assignment_id: token_uuid)`
450
returns the row that does exist. `authenticate/1` then answers
451
`{:error, :invalid_assignment_credential}`.
452
453
### Criterion (c) status
454
455
No branch reached the forge and no push receipt was recorded;
456
`git ls-remote refs/heads/assignment/*` is empty and the branch read answers
457
`404`. Criterion (c) remains unmet. The dispatch half is demonstrated live; the
458
authentication half is blocked on the defect above, which is one query in
459
`authenticate/1`.

This page updates live while a promote is in flight · changelog