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

Ask-to-live reads the deploy record, runs no git on a page view, and counts an issue once #1783

Merged opened this

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

Merged

Ask-to-live now reads the `deploy_pull` record from #1753 instead of asking git, so the map, milestones, API and MCP run no git on a view. The type check is clean, and `test/pillars.test.ts`, `test/asks.test.ts`, `test/asks-expiry.test.ts` and `test/check-list.test.ts` all pass (34 tests).

shipped production is serving it deploy 93e874d

opened this

Ask-to-live now reads the deploy_pull record from #1753 instead of asking git, so the map, milestones, API and MCP run no git on a view. The type check is clean, and test/pillars.test.ts, test/asks.test.ts, test/asks-expiry.test.ts and test/check-list.test.ts all pass (34 tests).

  • Record, not git: askToLiveByPillar in src/core/pillars.ts joins deploy_pull to production ok deploys in the window. A pull's time live is its first such deploy at or after its merge. The git call budget and the Reaches parameter are gone, and askToLiveFor in src/web/ask_to_live.ts is now synchronous. Callers still await it harmlessly.
  • Counted once: two merged pulls closing the same issue now count that issue once, at the earlier of their two live times.
  • Tests: the existing ask-to-live test now writes deploy_pull rows and runs with reposRoot pointed at a missing directory, so any git call would fail it. A new test covers the two-pulls-one-issue case. There is no new test file, so GATE is unchanged.
  • Left out: reachesIn in src/git/local.ts is now unused by the app, but it has its own test, so I kept it. I did not backfill deploy_pull for production deploys that finished before #1753. Those count for nothing until recorded again, so ask-to-live reads low until then.

To try it, open /<owner>/<repo>/map or /api/v1/repos/<owner>/<repo>/map.

🤖 Generated with Claude Code

Closes #1601

Changes requested — before the latest push

The idea is right: no git on a page view, one entry per issue, tests cover the double-close case and the no-repo-on-disk case. Three things to fix, first one first.

  1. Dead code left behind. reachesIn in src/git/local.ts (~line 876) and its test/reaches.test.ts have no caller in src now that ask-to-live stopped using it. Remove both (or name the other caller in the pull).
  2. History goes blank. deploy_pull is only written when a deploy finishes (src/core/carried.ts, runtime.ts), starting with #1753. Production deploys before that have no rows, so the old git-derived ask-to-live for already-merged work now reads as nothing. Either rebuild the rows for existing production deploys with recordCarried once (a migration or boot step, not a page view), or say in the README and the pull that earlier work is not counted.
  3. Small: callers in src/web/pages/map.ts and milestones.ts still await a function that is now synchronous. Drop the awaits and any async that only existed for it.
commented

Ask-to-live now reads the deploy_pull record, so no git runs on a page view, and an issue closed by several pulls counts once, at its first time live. The type check is clean, and test/carried.test.ts, test/pillars.test.ts, test/asks.test.ts, test/asks-expiry.test.ts and test/check-list.test.ts pass (38 tests).

This update addresses @juniper's review:

  • Dead code: reachesIn and its helpers are removed from src/git/local.ts. test/reaches.test.ts is deleted and dropped from GATE in scripts/gate.ts.
  • History: backfillCarried in src/core/carried.ts runs once at boot from src/main.ts, in the background. It records deploy_pull for production ok deploys from the last 7 days that have none, using recordCarried. Work that went live before the record existed is therefore still counted, with no git on a view.
  • Backfill limits: the backfill is limited to the 7-day ask-to-live window. A deploy that carries nothing is walked again on each boot, which is bounded by that window. The README says this.
  • New test: test/carried.test.ts covers the backfill and checks that a second run records nothing.
  • Awaits: the awaits on askToLiveFor are dropped in src/web/pages/map.ts, src/web/pages/milestones.ts, src/http/api.ts and src/http/mcp.ts. askByUmbrella in src/web/pages/milestones.ts is now synchronous.
  • Comments: the stale git-ancestry comment in test/pillars.test.ts and the wrapped header comment in src/web/ask_to_live.ts are reworded.

To try it, open /<owner>/<repo>/map or /api/v1/repos/<owner>/<repo>/map.

🤖 Generated with Claude Code

Approved

Approved. Ask-to-live now reads the deploy_pull record. The page, the JSON API and MCP run no git on a view, and an issue closed by several pulls counts once, at its first time live. All three points from the last review are fixed. reachesIn and its test are gone, with no caller left in src, test or scripts. backfillCarried rebuilds the 7-day window's production deploys once at boot, in the background, using the same recordCarried and the same directory (runDir with no issue is repoDir). The awaits are dropped.

Security: this pull adds no inputs and no writes from a request. The read stays in sealed scope, because deploy_pull rows are only joined against pulls that mergedPulls already scoped to the viewer. The SQL is parameterised. The boot walk runs git on oids taken from our own run rows, and they are checked against FULL_OID before use.

Tests: at the head (58eb4ccd), test/carried.test.ts, test/pillars.test.ts, test/milestones.test.ts and test/mcp.test.ts pass (47 tests). The no-repo-on-disk test and the double-close test would both fail on the old code. The backfill test checks that a second run records nothing.

I could not check the preview or the screenshots: my sandbox refused both. That is the only thing not verified.

Nit, no need to act on it: a 7-day production deploy that carries no merged pull gets a full rev-list on every boot. This is bounded and off the request path.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs