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

An edge-kept finding hands the owner the exact edge cache rule to paste, on the issue and on /maintenance #17054

Merged opened this

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

Merged

The edge-kept finding now carries the edge cache rule as one copyable block, and the duty closes its own finding once the rule is in. src/maintain/edgekept.ts, src/maintain/duties/edgekept.ts and test/maintain-edge-kept.test.ts pass 18 tests, plus the related maintenance duty tests.

Notes

opened this

The edge-kept finding now carries the edge cache rule as one copyable block, and the duty closes its own finding once the rule is in. src/maintain/edge_kept.ts, src/maintain/duties/edge_kept.ts and test/maintain-edge-kept.test.ts pass 18 tests, plus the related maintenance duty tests. bun x tsc --noEmit is clean and gate.ts --explain shows 0 failing rules. design-lint and the full suite did not complete in my sandbox; the forge's check will run them.

What changed

  • Rule block: the issue body the duty files holds a fenced block. It matches a signed-out GET of HTML with no session cookie, says cache eligible and respect origin Cache-Control, and keys on one line per header of EDGE_VARY. The block is built from EDGE_VARY by edgeRule(), never typed out.
  • Auto-close: when both reads in a run are HIT, STALE or REVALIDATED, the duty comments with the header it saw and closes its open finding. If only one read is kept, the finding stays open, so it can't flap. The action line says kept; that wording already existed and the test now checks it.
  • Link on /maintenance: the edge-kept duty row links to the open finding as "open finding owner/name#N". Nothing shows when no finding is open. The terminal's duty list shows the same text. No new page.
  • Tests: the new tests check that the body's key list equals EDGE_VARY, that a kept page closes the finding with the header in a comment, and that a page still not kept, or kept on one read only, leaves it open. openFinding is covered too. I changed one existing assertion that looked for the literal Cookie, Authorization; the keys are now on separate lines.
  • Docs: docs/features/maintenance-duties.md (Edge kept) says the duty closes its own finding.
  • Reused: fileIssueOnce, edgeKept and getIssue, plus the existing addComment and setIssueState. PATHS and title moved into src/maintain/edge_kept.ts so the page and the terminal can find the finding; the duty file re-exports them.

Left out

  • The rule is plain text, not a Cloudflare API payload or Terraform.
  • Only / and /explore are covered.

To try Run the duty against a forge whose edge returns cf-cache-status: DYNAMIC, then read the filed issue. Change the edge to HIT and run it again. The finding closes with a comment. As an admin, /maintenance shows the link while the finding is open.

I added an empty "Try:" commit because the pre-push hook required one.

Closes #17016

5 earlier comments
commented

The edge-kept finding now carries the edge cache rule as one copyable block, and the duty closes its own finding once the rule is in. src/maintain/edge_kept.ts, src/maintain/duties/edge_kept.ts and test/maintain-edge-kept.test.ts pass 18 tests, plus the related maintenance duty tests. bun x tsc --noEmit is clean and gate.ts --explain shows 0 failing rules. design-lint and the full suite did not complete in my sandbox; the forge's check will run them.

What changed

  • Rule block: the issue body the duty files holds a fenced block. It matches a signed-out GET of HTML with no session cookie, says cache eligible and respect origin Cache-Control, and keys on one line per header of EDGE_VARY. The block is built from EDGE_VARY by edgeRule(), never typed out.
  • Auto-close: when both reads in a run are HIT, STALE or REVALIDATED, the duty comments with the header it saw and closes its open finding. If only one read is kept, the finding stays open, so it can't flap. The action line says kept; that wording already existed and the test now checks it.
  • Link on /maintenance: the edge-kept duty row links to the open finding as "open finding owner/name#N". Nothing shows when no finding is open. The terminal's duty list shows the same text. No new page.
  • Tests: the new tests check that the body's key list equals EDGE_VARY, that a kept page closes the finding with the header in a comment, and that a page still not kept, or kept on one read only, leaves it open. openFinding is covered too. I changed one existing assertion that looked for the literal Cookie, Authorization; the keys are now on separate lines.
  • Docs: docs/features/maintenance-duties.md (Edge kept) says the duty closes its own finding.
  • Reused: fileIssueOnce, edgeKept and getIssue, plus the existing addComment and setIssueState. PATHS and title moved into src/maintain/edge_kept.ts so the page and the terminal can find the finding; the duty file re-exports them.

Left out

  • The rule is plain text, not a Cloudflare API payload or Terraform.
  • Only / and /explore are covered.

To try Run the duty against a forge whose edge returns cf-cache-status: DYNAMIC, then read the filed issue. Change the edge to HIT and run it again. The finding closes with a comment. As an admin, /maintenance shows the link while the finding is open.

I added an empty "Try:" commit because the pre-push hook required one.

commented

<!-- look-pages 5ce0efc18f68 --> Look pages for 5ce0efc, from the gate:

  • look pages (inferred): this pull changes src/web/pages/maintenance.ts; the forge pictures /maintenance (src/web/pages/maintenance.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The gate, tsc and the tests that cover this change all pass, so I pushed no new commit. The look-pages comment is the gate's inference and it didn't fail anything. The inferred look page is /maintenance, which this pull does change.

The four recurring refusals don't apply here:

  • Dead code: test/unused-exports.test.ts passes. It prints a note that streamLag in src/snapshot/stream.ts is no longer dead. That file isn't in this diff.
  • Name the issue: the gate's "name the issue" rule passes.
  • Tests: test/maintain-edge-kept.test.ts builds real records, with no as never. It passes along with test/hollow.test.ts and the dead-code test.
  • Timed jobs: the pull adds no job under during.

What changed: when an edge-kept finding is open, it holds the edge cache rule as one block built from EDGE_VARY. /maintenance links the edge-kept row to that open finding. The finding closes itself once both reads are kept.

Left out: no new look-page override. The inferred /maintenance picture is the right page, so I added no Looks: or No look: line.

Not run: bun scripts/fast.ts named a long list of tests (too broad for the sandbox), so I ran only the four files above, not the broader set. The forge's full check covers the rest.

To try it: open /maintenance as an admin. The edge-kept row links to the open finding, and its body holds the edge rule block.

[{"go":"/maintenance (admin)","look":"the edge-kept row","expect":"it links to the open finding"},{"go":"the linked finding","look":"its body","expect":"one block holding the edge cache rule built from EDGE_VARY"}]

🤖 Generated with Claude Code

commented

Both review points are addressed and pushed as b8d1dcbb0. The edge-kept tests, tsc, bun scripts/design-lint.ts and the gate pass. I ran only test/maintain-edge-kept.test.ts, not the broader suite, so the forge's check will run the rest.

  • One way to find the finding: findingFor(db, repo, path) in src/maintain/edge_kept.ts is now the only open-finding query. The duty's close step and openFinding (the /maintenance link and the terminal suffix) both call it.
  • Link tests: a new test in test/maintain-edge-kept.test.ts signs in as an admin and checks the page and dutyLines.
    • With no finding, neither shows "open finding".
    • After the duty files one, the page has <a href="/<repo>/issues/N" data-filed="link">open finding <repo>#N</a>, and the terminal line has ; open finding <repo>#N.
    • Once the findings are closed, both go away.
  • data-filed="link": I kept it. The same page already uses it for filed-issue links (src/web/pages/maintenance.ts lines 75–76), so it matches the existing pattern. It isn't named in docs, and bun scripts/design-lint.ts reports nothing outside the system.
  • Commit trailers: the commit carries Looks: /maintenance and a Direction: … (#17016) line.
commented

<!-- look-pages b8d1dcbb02e3 --> Look pages for b8d1dcb, from the gate:

  • look pages (named): this pull changes src/web/pages/maintenance.ts; a commit names /maintenance
commented

No code changed in this round. The look-pages item is a NOTE from the gate, not a failure. The gate and bun x tsc --noEmit both ran clean on the branch, and the working tree is clean. I didn't re-run the tests or push.

The NOTE says "this pull changes src/web/pages/maintenance.ts; a commit names /maintenance". The rule is met: commit b8d1dcbb0 carries Looks: /maintenance, and its message also carries a Direction: … (#17016) line that names the issue.

I checked the four recurring refusals against this pull:

  • Dead exports: this pull adds no new export. Its one new helper, findingFor, is called from both the duty and the link.
  • as never: the new tests build real records.
  • Timed jobs: the pull adds no job.
  • Issue number: the commits cite #17016.

What changed: the edge-kept finding body now holds the edge rule as one block built from EDGE_VARY. /maintenance and the terminal link to the open finding and drop the link once both reads are kept. A test covers each of these.

What I left out: there is no new page and no new dependency.

How to try it: open /maintenance as an admin. The edge-kept row links to the open finding.

[{"go":"/maintenance (as admin)","look":"edge-kept row","expect":"links to the open finding whose body holds the edge rule block; the link disappears once the finding is closed"}]
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs