@odla-ai/chapter 0.25.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -641,9 +641,14 @@ These bite silently — a smoke test won't catch them:
641
641
  - **CRM projection points.** chapter projects the person on application submit
642
642
  (`projectApplicant`), not on booking or on webhook status change. If you mirror
643
643
  pipeline stage into the CRM, keep those routes.
644
- - **Route names.** chapter serves `/api/config`, `/api/join-config`, etc. Alias
645
- legacy names in ~4 lines with a host route in `chapterWorker({ routes })` rather
646
- than rewriting pages.
644
+ - **Route contracts, not route names.** Chapter serves `/api/config`,
645
+ `/api/join-config`, etc. Alias a legacy URL with a host route only after
646
+ method, auth, request, response shape, units, status, and header parity are
647
+ proven. Equal values with different JSON contracts are not compatible. For a
648
+ join flow, adopt `JoinIsland` end to end or keep an explicit tested adapter;
649
+ do not merely repoint an existing page at `/api/join-config`. `PaymentStep`
650
+ obtains Stripe's `clientSecret`, `publishableKey`, and `lineItems` from
651
+ `POST /api/payments/subscription`, not from the public join-config response.
647
652
 
648
653
  ### Install + scope notes
649
654
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odla-ai/chapter",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "A leader/follower foundation for branded membership sites: shared CRM, admin, auth, payments, booking, and explicit record delivery from one defineChapter config.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://odla.ai/docs/packages/chapter",
@@ -68,6 +68,16 @@ Create or extend root `MIGRATION.md`; never replace its history. Record state
68
68
  render sink;
69
69
  - telemetry, freshness/error alerts, deploy commands, and CI auto-deploys.
70
70
 
71
+ For every route, record the method/path, current consumer, owning implementation
72
+ (`legacy`, Chapter, or an explicit host adapter), request and response schemas,
73
+ status/error/auth/cache behavior, and its evidence. Source evidence names the
74
+ checked-in path plus commit; deployment evidence names the origin plus immutable
75
+ Worker/deployment version. A response observed on an unversioned deployment
76
+ describes only that deployed build at that moment. It does not establish route
77
+ ownership or the contract of the branch being changed. Treat old branches, git
78
+ history, and unrelated deployments as leads to verify, never as the migration
79
+ specification.
80
+
71
81
  ### Freeze visual and behavior evidence
72
82
 
73
83
  Capture representative production screenshots and measured layouts at 390,
@@ -150,13 +160,20 @@ explicit:
150
160
 
151
161
  Before deleting old schema/rules/provisioning:
152
162
 
153
- 1. freeze the legacy schema and rules as reviewed test fixtures;
154
- 2. normalize only approved representational differences;
155
- 3. compare `createChapterIntegration(chapter)` namespaces, attrs, links, rules,
156
- and seeds to the fixtures;
157
- 4. fail on missing fields, widened rules, cardinality changes, renamed natural
163
+ 1. freeze the legacy schema and rules from an exact reviewed source path and
164
+ commit, with a recorded content digest;
165
+ 2. make that baseline independent: use the untouched legacy source or a literal
166
+ fixture that does not import Chapter, the active descriptor/schema alias, or
167
+ another generated candidate; do not modify baseline and candidate in the
168
+ same approval;
169
+ 3. normalize only approved representational differences;
170
+ 4. compare `createChapterIntegration(chapter)` namespaces, attrs, links, rules,
171
+ and seeds to the independent baseline;
172
+ 5. run a negative control by removing or changing a known field/rule on one side
173
+ and prove the parity test fails before trusting a green result;
174
+ 6. fail on missing fields, widened rules, cardinality changes, renamed natural
158
175
  keys, new client-readable data, or unapproved seed differences;
159
- 5. record every intentional delta and migration mapping in `MIGRATION.md`.
176
+ 7. record every intentional delta and migration mapping in `MIGRATION.md`.
160
177
 
161
178
  `createChapterIntegration()` inserts the group seed only when absent. Existing
162
179
  runtime owner edits do not update from later config changes. Compare the current
@@ -343,10 +360,25 @@ Do not replace schema, worker, routes, and UI in one unreviewable change.
343
360
  routes run before built-ins and receive Chapter's existing context
344
361
  (`verifyUser`, `makeDb`, `roleFor`, `isAdmin`); do not verify JWTs twice.
345
362
  3. Initially keep every bespoke endpoint as a host route. Alias legacy URLs to
346
- Chapter behavior instead of breaking clients.
347
- 4. Compare built-in and legacy behavior route by route; only then remove a host
348
- route that Chapter fully owns.
349
- 5. Keep static fallback and API handling explicit so unknown APIs cannot fall
363
+ Chapter behavior only when the route-contract matrix proves method, auth,
364
+ request body, response status, JSON keys/types/nesting, units, null/omission
365
+ semantics, and relevant headers are compatible. Matching business values
366
+ alone is not response-shape parity.
367
+ 4. When contracts differ, keep the legacy route until its consumer adopts the
368
+ packaged Chapter component end to end, or add an explicit adapter with
369
+ contract tests. Do not simply repoint the existing browser code.
370
+ 5. In Chapter 0.25, `/api/join-config` is Chapter-owned and returns the
371
+ group-scoped join configuration, raw cent values, policy copy, and readiness;
372
+ it is not a promise to reproduce a legacy route's prebuilt Stripe line items
373
+ or publishable key. `JoinIsland` delegates payment to `PaymentStep`, which
374
+ obtains `clientSecret`, `publishableKey`, and `lineItems` from
375
+ `POST /api/payments/subscription` after application submission and refund
376
+ acknowledgement. Verify this installed-version contract before retiring a
377
+ legacy join route.
378
+ 6. Compare built-in and legacy behavior route by route; only then remove a host
379
+ route that Chapter fully owns and whose consumers use the verified Chapter
380
+ contract or adapter.
381
+ 7. Keep static fallback and API handling explicit so unknown APIs cannot fall
350
382
  through to a successful SPA document.
351
383
 
352
384
  Test public/private method policies, body limits, idempotency, auth 401 vs 403,
@@ -493,9 +525,12 @@ selected account invitation effect. Never let dev send to imported members.
493
525
 
494
526
  Check in an executable acceptance manifest with:
495
527
 
496
- - actual dev URLs and Worker version ids;
528
+ - actual dev URLs and immutable Worker version ids, paired with the source
529
+ commit they are expected to run;
497
530
  - deterministic synthetic member/application ids;
498
- - expected routes/statuses, schema/counts/freshness, and Chapter backend marker;
531
+ - expected route owners and full request/response contracts—not only paths,
532
+ statuses, or equal values—plus schema/counts/freshness and Chapter backend
533
+ marker;
499
534
  - expected migration-readiness inputs and a `200` only when each is green;
500
535
  - expected account, payment, booking, email, CRM, and admin outcomes;
501
536
  - expected o11y service/release and safe trace;
@@ -521,6 +556,14 @@ Run the real journey:
521
556
  `doctor`, unit tests, build, CLI smoke, a login page, and a human-looking admin
522
557
  screen are necessary but not sufficient.
523
558
 
559
+ Before filing a route bug from deployed evidence, prove that the probed
560
+ deployment runs the intended commit/version. Repeat the request against the
561
+ direct candidate origin and the public domain with a unique non-secret query
562
+ value, capture `Age`, `Cache-Control`, `CF-Cache-Status`, `ETag`, and the Worker
563
+ version marker, and re-test after the documented edge/config propagation
564
+ window. A cached pre-deploy or pre-credential `404` is not evidence that the
565
+ current route is absent.
566
+
524
567
  ## Phase 8 — Production parallel run and cutover
525
568
 
526
569
  Do not add production until the human approves the full dev report and both