Public: anyone can read this; the crew can change it.

Production's daily proof passes at least one line after the in-process read lands #15951

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

If none of the daily proof's lines got an answer, the proof now runs again an hour later instead of waiting a day. Once this deploys, production should show its first real pass count within the hour. That run hasn't happened yet, so this pull doesn't prove pass > 0.

Notes

shipped production is serving it deploy 3fede26

opened this

If none of the daily proof's lines got an answer, the proof now runs again an hour later instead of waiting a day. Once this deploys, production should show its first real pass count within the hour. That run hasn't happened yet, so this pull doesn't prove pass > 0.

What production reads now. GET https://lab--forge-trevato-apps.open-platform.sh/api/v1/proof/daily returns at 2026-11-23T00:07:15.941Z, pass 0, total 8. Every line says no answer: Proxy refused to open a tunnel: 403 refused by this forge: lab--forge-trevato-apps.open-platform.sh:443 is not in this app's forge.json egress. That run is from before #15942, which merged at 10:11Z. /api/v1/health reports production on 0882841, which includes the in-process read. No code path still sends the proof's reads of its own origin through fetch, so the second box needs no fix.

Why it hasn't been proven. The duty is due 24 h after its last start, so its next run is about 2026-11-24T00:07Z. The only maintenance control, POST /maintenance/duties/:name, pauses and resumes duties; nothing starts a run on demand.

The change:

  • Duty interface: a duty can declare an optional dueAfterMs(db), a shorter interval based on what it last saw. Both the runner (src/maintain/runner.ts) and the /maintenance schedule (src/maintain/schedule.ts) use it.
  • The daily proof: if every line of its last run starts with no answer, it uses RETRY_MS (1 h) instead of a day. That covers the gate refusing every read, as it does now.
  • Budget: the duty's existing budget of 2 runs a day caps this at one retry per day, so a gate that keeps refusing costs one extra run a day, not 24.
  • When a run counts: one answered line, even a FAIL, means the run counts and the next one waits its full day.

Tests: test/daily-proof.test.ts adds two:

  • Runner timing: drives the real runner. A run with every line refused is followed by nothing at 59 min, a run at 61 min that now gets answers, and nothing at 3 h. It fails without the runner change (checked by stashing it).
  • unanswered(): checks the rule for no run, an empty run, an all-refused run and a mixed run.

Checks: bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. scripts/fast.ts named 2579 files, too many to run here, so I ran these 10 instead, and all 103 tests pass: daily-proof, maintain, maintenance, maintenance-duties, maintenance-last-run, maintain-pause, maintenance-json, maintenance-page, duty-roster, maintain-v1-proven.

Not done:

  • Egress list: forge.json egress is unchanged, as the issue asks.
  • Other duties hitting the gate: edge_kept (hourly) and wait_split (every 6 h) also call fetch on config.url. They are probably most of the 212 refusals the forge reports against this app's own host. They are outside this issue's files, and edge_kept exists to read the edge, so answering it in process would defeat it. Each needs its own issue.

To try: after this deploys, read /api/v1/proof/daily within the hour. at should be a fresh time and pass above 0, and /maintenance should show daily-proof as due. Someone still has to tick the issue's first box with those numbers.

🤖 Generated with Claude Code

Closes #15946

3 earlier comments · 2 events
commented

If none of the daily proof's lines got an answer, the proof now runs again an hour later instead of waiting a day. Once this deploys, production should show its first real pass count within the hour. That run hasn't happened yet, so this pull doesn't prove pass > 0.

What production reads now. GET https://lab--forge-trevato-apps.open-platform.sh/api/v1/proof/daily returns at 2026-11-23T00:07:15.941Z, pass 0, total 8. Every line says no answer: Proxy refused to open a tunnel: 403 refused by this forge: lab--forge-trevato-apps.open-platform.sh:443 is not in this app's forge.json egress. That run is from before #15942, which merged at 10:11Z. /api/v1/health reports production on 0882841, which includes the in-process read. No code path still sends the proof's reads of its own origin through fetch, so the second box needs no fix.

Why it hasn't been proven. The duty is due 24 h after its last start, so its next run is about 2026-11-24T00:07Z. The only maintenance control, POST /maintenance/duties/:name, pauses and resumes duties; nothing starts a run on demand.

The change:

  • Duty interface: a duty can declare an optional dueAfterMs(db), a shorter interval based on what it last saw. Both the runner (src/maintain/runner.ts) and the /maintenance schedule (src/maintain/schedule.ts) use it.
  • The daily proof: if every line of its last run starts with no answer, it uses RETRY_MS (1 h) instead of a day. That covers the gate refusing every read, as it does now.
  • Budget: the duty's existing budget of 2 runs a day caps this at one retry per day, so a gate that keeps refusing costs one extra run a day, not 24.
  • When a run counts: one answered line, even a FAIL, means the run counts and the next one waits its full day.

Tests: test/daily-proof.test.ts adds two:

  • Runner timing: drives the real runner. A run with every line refused is followed by nothing at 59 min, a run at 61 min that now gets answers, and nothing at 3 h. It fails without the runner change (checked by stashing it).
  • unanswered(): checks the rule for no run, an empty run, an all-refused run and a mixed run.

Checks: bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. scripts/fast.ts named 2579 files, too many to run here, so I ran these 10 instead, and all 103 tests pass: daily-proof, maintain, maintenance, maintenance-duties, maintenance-last-run, maintain-pause, maintenance-json, maintenance-page, duty-roster, maintain-v1-proven.

Not done:

  • Egress list: forge.json egress is unchanged, as the issue asks.
  • Other duties hitting the gate: edge_kept (hourly) and wait_split (every 6 h) also call fetch on config.url. They are probably most of the 212 refusals the forge reports against this app's own host. They are outside this issue's files, and edge_kept exists to read the edge, so answering it in process would defeat it. Each needs its own issue.

To try: after this deploys, read /api/v1/proof/daily within the hour. at should be a fresh time and pass above 0, and /maintenance should show daily-proof as due. Someone still has to tick the issue's first box with those numbers.

🤖 Generated with Claude Code

commented

If none of the daily proof's lines got an answer, the proof now runs again an hour later instead of waiting a day. This pull doesn't prove pass > 0 on production yet; the issue's first box still needs someone to read the live numbers after a run.

What production reads now. GET https://lab--forge-trevato-apps.open-platform.sh/api/v1/proof/daily returns at 2026-11-23T00:07:15.941Z, pass 0, total 8. Every line says no answer: Proxy refused to open a tunnel: 403 refused by this forge: lab--forge-trevato-apps.open-platform.sh:443 is not in this app's forge.json egress. That run is from before #15942, which merged at 10:11Z. /api/v1/health reports production on 0882841, which includes the in-process read. No code path still sends the proof's reads of its own origin through fetch, so the second box needs no fix.

The change:

  • Duty interface: a duty can declare an optional dueAfterMs(db), a shorter interval based on what it last saw. Both the runner (src/maintain/runner.ts) and the /maintenance schedule (src/maintain/schedule.ts) use it.
  • The daily proof: if every line of its last run starts with no answer, it uses RETRY_MS (1 h) instead of a day. That covers the gate refusing every read, as it did before #15942.
  • When a run counts: one answered line, even a FAIL, means the run counts and the next one waits its full day.

Merged with main's #15937. Main now also runs the proof once each time a release goes live, through dueNow. The two hooks sit side by side in the runner: a duty is due when its interval (or the shorter retry) has passed, or when dueNow says so. Main also raised the duty's budget from 2 to 24 runs a day, so a gate that keeps refusing could now trigger one retry an hour. With reads answered in process, a run where nothing answers means the forge itself didn't respond, and checking hourly seems right for that.

Tests: test/daily-proof.test.ts adds two:

  • Runner timing: drives the real runner. A run with every line refused is followed by nothing at 59 min, a run at 61 min that now gets answers, and nothing at 3 h. It fails without the runner change (checked by stashing it).
  • unanswered(): checks the rule for no run, an empty run, an all-refused run and a mixed run.

Checks: after the merge, bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. scripts/fast.ts named 2579 files, too many to run here, so I ran these 8 instead, and all 84 tests pass: daily-proof, maintain, maintenance, maintenance-duties, maintain-pause, maintenance-last-run, maintenance-json, duty-roster.

Not done:

  • Egress list: forge.json egress is unchanged, as the issue asks.
  • Other duties hitting the gate: edge_kept (hourly) and wait_split (every 6 h) also call fetch on config.url. They are probably most of the refusals the forge reports against this app's own host. They are outside this issue's files, and edge_kept exists to read the edge, so answering it in process would defeat it. Each needs its own issue.

To try: after this deploys, read /api/v1/proof/daily once the release has settled, or within the hour if the newest run read nothing. at should be a fresh time and pass above 0. Someone still has to tick the issue's first box with those numbers.

🤖 Generated with Claude Code

Changes requested — before the latest push

Production already answers: GET /api/v1/proof/daily now reads at 2026-11-23T10:27:50.515Z, release 2bf5039, pass 9, total 9. That run came from the post-release trigger (#15945) once the in-process read (#15936/#15942) was live. The reads no longer go through the egress gate, so the problem this pull retries around is gone.

What to change, in one round:

  1. Drop the retry machinery: dueAfterMs in duty.ts, its use in runner.ts and schedule.ts, RETRY_MS/unanswered in release/daily_proof.ts, and the two tests. Issue #15946 box 3 says to record the reasons and open nothing else. A new Duty interface hook that makes the runner rerun hourly for ever is more than that. It also costs a run an hour whenever the forge is down, against the owner's pipeline-first direction.
  2. Replace it with a pull that records the evidence for the boxes: at 2026-11-23T10:27:50.515Z, pass 9, total 9, plus a line that no fetch of the forge's own origin remains in the proof path.
  3. If you still want the retry, open a separate issue and justify it there. Keep dueAfterMs out of this pull.

Security, tests and cleanliness of the code as written are otherwise fine, and the preview serves / with 200. The problem is scope and necessity.

commented

Production already passes: GET /api/v1/proof/daily on https://lab--forge-trevato-apps.open-platform.sh shows at 2026-11-23T10:27:50.515Z, release 2bf5039, pass 9, total 9. That run was started by the post-release trigger (#15945) after the in-process read (#15936/#15942) went live.

So this pull only records that result. The hourly retry from the earlier push is removed: dueAfterMs in src/maintain/duty.ts, its use in runner.ts and schedule.ts, RETRY_MS/unanswered in src/release/daily_proof.ts, and their two tests. Those files now match main exactly. After merging main, the only change in this pull is a new section in docs/features/daily-proof.md. It records the evidence:

  • Before the fix, at 2026-11-23T00:07:15.941Z, production read 0 of 8, with every line refused by the egress gate.
  • Now it reads 9 of 9.
  • No fetch of the forge's own origin is left in the proof path. In src/maintain/duties/daily_proof.ts, reads of that origin go through ownFetcher (src/release/own_fetch.ts), which hands them to the forge's own router. Only other origins reach the global fetch.

That covers the issue's box 1 (at/pass/total from a run after the release). Box 2 doesn't apply, because no line says "refused by this forge" any more. For box 3, all nine lines pass, so there are no failure reasons to record and nothing else is opened. No retry issue is filed either: with 9 of 9 there is no case for one. forge.json egress is unchanged.

Checks run: bun scripts/gate.ts --fix changed nothing. bun x tsc --noEmit is clean. test/daily-proof.test.ts and every test that reads docs/features passed (403 tests across 42 files, 0 failures). scripts/fast.ts listed 3434 test files because the merge from main touched many files, so I picked those tests myself.

To try it: curl https://lab--forge-trevato-apps.open-platform.sh/api/v1/proof/daily, and read the "Proven on production (#15946)" section of docs/features/daily-proof.md.

🤖 Generated with Claude Code

Approved

Docs-only; scope is right after the retry machinery was dropped. ownFetcher exists and is used in the proof duty. Production reads pass 9 / total 9 (a later run, 10:43Z, also 9/9), matching the recorded 10:27:50Z run. The how-to stays in docs/features, not README. No code, so no security surface.

commented

Left #15946 open: 1 unticked item remain (If any line still reads "refused by this forge ... not in this app's forge.json egress", find the fetch that still goes out through fetch for the forge's own origin and route it through the in-process handler; add a test with a seeded base equal to the forge's origin that fails without the change.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs