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

The v1 proof can read the lapse rule: /pricing states the grace period and that a lapsed forge sleeps, in text a probe can match #12514

Merged opened this

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

Merged

/pricing now says how many days of grace a lapsed payment has and that the forge then sleeps and keeps its data. GET /api/v1/plans carries the same two facts as graceDays and lapse: "sleep". tsc, the gate, design-lint and the 871 tests in the pricing, plans, billing, contract and v1-proven files pass.

Notes

shipped production is serving it deploy d73d768

opened this

/pricing now says how many days of grace a lapsed payment has and that the forge then sleeps and keeps its data. GET /api/v1/plans carries the same two facts as graceDays and lapse: "sleep". tsc, the gate, design-lint and the 871 tests in the pricing, plans, billing, contract and v1-proven files pass. I did not run the full suite; the forge runs it on push.

  • Page: under the plans, one <p data-lapse="sleep" data-grace-days="N"> reads "If a payment lapses, you have N days of grace. After that your forge sleeps and keeps its data."
  • Source of the number: a new src/billing/lapse_rule.ts reads billing.grace_days through limitValue. The page and the API both use it, so there is no second constant.
  • API: graceDays and lapse sit beside items in the /api/v1/plans response, and the OpenAPI summary names them.
  • Probe: the #11140 probe in scripts/v1-proven.ts now passes only if three things hold:

- The attribute is present. - The sentence is present and its number equals the attribute. - /api/v1/plans says lapse: "sleep" with the same graceDays.

If one is missing or the numbers differ, it fails. #11141 is still unproven.

  • Tests:

- test/pricing-order.test.ts checks that the page and the API follow the setting, and that changing billing.grace_days to 11 changes both. - test/v1-proven.test.ts has probe-failure cases for a missing sentence, a missing field, a number that differs between page and API, and sentence against attribute. - The "all unproven" expectations now name only #11141.

Left out: the probe reads the lapse rule, not the sleeping itself, so it proves what the page says rather than what the forge does when it sleeps. The #11141 CPU-slowing and plan-change reads are untouched.

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

To try: open /pricing and read the line below the plans. Run bun scripts/v1-proven.ts <url> against a preview.

Closes #12513

4 earlier comments · 1 event
commented

/pricing now says how many days of grace a lapsed payment has and that the forge then sleeps and keeps its data. GET /api/v1/plans carries the same two facts as graceDays and lapse: "sleep". tsc, the gate, design-lint and the 871 tests in the pricing, plans, billing, contract and v1-proven files pass. I did not run the full suite; the forge runs it on push.

  • Page: under the plans, one <p data-lapse="sleep" data-grace-days="N"> reads "If a payment lapses, you have N days of grace. After that your forge sleeps and keeps its data."
  • Source of the number: a new src/billing/lapse_rule.ts reads billing.grace_days through limitValue. The page and the API both use it, so there is no second constant.
  • API: graceDays and lapse sit beside items in the /api/v1/plans response, and the OpenAPI summary names them.
  • Probe: the #11140 probe in scripts/v1-proven.ts now passes only if three things hold:

- The attribute is present. - The sentence is present and its number equals the attribute. - /api/v1/plans says lapse: "sleep" with the same graceDays.

If one is missing or the numbers differ, it fails. #11141 is still unproven.

  • Tests:

- test/pricing-order.test.ts checks that the page and the API follow the setting, and that changing billing.grace_days to 11 changes both. - test/v1-proven.test.ts has probe-failure cases for a missing sentence, a missing field, a number that differs between page and API, and sentence against attribute. - The "all unproven" expectations now name only #11141.

Left out: the probe reads the lapse rule, not the sleeping itself, so it proves what the page says rather than what the forge does when it sleeps. The #11141 CPU-slowing and plan-change reads are untouched.

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

To try: open /pricing and read the line below the plans. Run bun scripts/v1-proven.ts <url> against a preview.

commented

/pricing and /api/v1/plans now state the lapse rule: after the grace days from the setting, the forge sleeps. The v1 #11140 probe can read it under the plans on /pricing.

The last check failed only on the gate rule "before/after looks", because src/web/pages/pricing.ts changed. /pricing isn't in app.looks in forge.json, so there is no page to take pictures of. I added an empty commit carrying a "No look:" line that says so. The gate now passes locally and the branch is pushed. I didn't run tsc or any tests, since no code changed since the last push.

I left /pricing out of app.looks. Adding it would be a separate decision for a person.

To try it, open /pricing on the preview and read the line under the plans about a lapsed payment.

commented

/pricing and GET /api/v1/plans now state the lapse rule, so the v1 #11140 probe can read it. The check on the last push failed in cell and egress tests, and I found no cause in this change. I have not reproduced those failures, so a red check on the new push would mean they are real.

What changed

  • src/billing/lapse_rule.ts (new) reads the grace days from the billing.grace_days setting and says that after that the forge sleeps and keeps its data.
  • /pricing prints that sentence and carries the number in data-grace-days.
  • /api/v1/plans adds graceDays and lapse: "sleep" beside the plans.
  • scripts/v1-proven.ts now checks that the page's words, its attribute and the API all agree, and that the lapse is "sleep".
  • test/pricing-order.test.ts and test/v1-proven.test.ts cover the sentence, the attribute and the API fields.

The red check

  • The change touches no spawn, cell or egress code. The kid--forge.test and parent.example refusals in the log come from the cell tests.
  • The failing spawn-stranger-cell, spawn-cell and trusted-hosts tests, plus pricing-order and v1-proven, pass here: 0 fail, but the unix-socket cell tests are skipped in this sandbox. The forge's check does run them.
  • main had moved 11 commits, and the check had that tip in view, so I merged main into the branch rather than rebasing, since force pushes are refused. scripts/gate.ts and bun x tsc --noEmit came back clean after the merge.
  • scripts/fast.ts said the diff is too broad to name tests (exit 2). I ran only the four test files above and then pushed, not the whole suite.

Left out

  • No before/after look for /pricing, as recorded in the earlier commit.

To try it Open /pricing and read the line under the plans, then curl /api/v1/plans.

Changes requested — before the latest push

Works in the preview: /pricing prints the sentence with data-grace-days=7 and /api/v1/plans carries graceDays and lapse. The number comes from billing.grace_days, and the tests and probe cover page, attribute and API. One fix is needed: docs/features/plans.md still says /api/v1/plans answers only the plans (line 19). It does not mention graceDays or lapse, or the new line on /pricing. Add both there (not in README).

commented

docs/features/plans.md now covers the lapse rule, which was the one fix you asked for. I changed no code and ran no tests, since this is a docs-only commit that I pushed to the same branch.

  • GET /api/v1/plans: the paragraph that said it answers only the plans now also names graceDays and lapse: "sleep". It says graceDays is the billing.grace_days setting, and that after the grace the forge sleeps and keeps its data.
  • /pricing: a new paragraph quotes the lapse sentence and says the element carries data-grace-days. It also says the number comes from the billing.grace_days setting through src/billing/lapse_rule.ts, so the page and the API change together.

The paragraph quotes the sentence with "7 days", which is the default I saw in the preview. If an admin changes the setting, the page shows the new number and the doc's example no longer matches it.

commented

I merged main into the branch and pushed it. The only conflict was in test/v1-proven.test.ts, and the 23 tests in that file pass. bun scripts/gate.ts and bun x tsc --noEmit came back clean. I did not run the rest of the suite here; the forge runs it on the push.

main had moved the schedule probe's test data into a health() helper. My branch still had the older sched helper, which nothing uses any more, so I dropped it. I kept the rule() helper for the lapse sentence and main's health().

In the "exits 3" test I took main's plain stub() call and rewrote its comment. With the lapse rule now proven, /pricing no longer counts as unproven, so only one item is left, which is what the existing "1 of 12 unproven" assertion expects.

Approved

Earlier ask met: the how-to is now in docs/features/plans.md, not README. The preview shows the sentence with data-grace-days=7 and /api/v1/plans carries graceDays 7 and lapse sleep. The number comes from the billing.grace_days setting in one module. One plain muted line under the plans, no new component or accent. Tests cover the sentence, the field and the setting change; probe cases cover each mismatch.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs