instar 1.3.242 → 1.3.243
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/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +1 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +1 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +6 -1
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +9 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +63 -63
- package/src/scaffold/templates.ts +1 -0
- package/upgrades/1.3.243.md +25 -0
- package/upgrades/apprenticeship-manual-cycle-write-path.eli16.md +9 -0
- package/upgrades/side-effects/apprenticeship-manual-cycle-write-path.md +52 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Side-Effects Review - Apprenticeship manual cycle write path
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `apprenticeship-manual-cycle-write-path`
|
|
4
|
+
**Date:** 2026-06-03
|
|
5
|
+
**Author:** codey
|
|
6
|
+
|
|
7
|
+
## Summary of the change
|
|
8
|
+
|
|
9
|
+
Current `JKHeadley/main` already had `POST /apprenticeship/cycles`, so this change does not add a second route. It finishes the manual/overseer write path around that existing route:
|
|
10
|
+
|
|
11
|
+
- `src/server/routes.ts` now validates that manual cycle POST bodies are objects and that `channel`, when present, is one of the four store-supported values.
|
|
12
|
+
- `src/server/CapabilityIndex.ts` now surfaces the apprenticeship cycle endpoints in `/capabilities`.
|
|
13
|
+
- `src/scaffold/templates.ts` adds a CLAUDE.md awareness blurb for manual cycle recording.
|
|
14
|
+
- `src/core/PostUpdateMigrator.ts` mirrors that blurb for existing agents that do not yet have the Apprenticeship Program section.
|
|
15
|
+
- `src/data/builtin-manifest.json` is regenerated after the route/source changes.
|
|
16
|
+
- `upgrades/next/apprenticeship-manual-cycle-write-path.md` records the release-note fragment required by the publish gate.
|
|
17
|
+
- Route and capability tests cover strict channel validation, channel persistence, manual overseer cycle capture, and discovery.
|
|
18
|
+
|
|
19
|
+
## Side effects and blast radius
|
|
20
|
+
|
|
21
|
+
The only behavior change on the write path is stricter HTTP validation. A malformed manual request with an unknown channel now receives HTTP 400 instead of being written as `unknown`. The lower-level `ApprenticeshipCycleStore.record()` behavior is unchanged, so legacy rows and automated/non-HTTP callers still normalize invalid or missing channels to `unknown`.
|
|
22
|
+
|
|
23
|
+
The route remains persistence-only. It does not mutate apprenticeship instance status, does not run lifecycle gates, and does not decide whether a cycle was good. It only writes the row to the cycle store, and existing role-coverage logic interprets those rows afterward.
|
|
24
|
+
|
|
25
|
+
Capability discovery changes only metadata returned by `/capabilities`; no new auth surface or prefix classification is introduced. `/apprenticeship` was already a public capability prefix, so no `INTERNAL_PREFIXES` entry is needed or appropriate.
|
|
26
|
+
|
|
27
|
+
The template and migrator changes alter generated/updated CLAUDE.md guidance text. They do not execute operational work. Existing installs that already have an Apprenticeship Program section are still protected by the current idempotency marker and will not be double-patched by this migration.
|
|
28
|
+
|
|
29
|
+
## Risks considered
|
|
30
|
+
|
|
31
|
+
- **Breaking automated mentor ticks:** low. The automated call site writes through the store, not the HTTP route, and does not provide a channel today. Store defaulting remains unchanged.
|
|
32
|
+
- **Rejecting useful manual records because of a typo:** intentional. Manual/overseer HTTP writes should fail loudly when the channel is not one of the program-defined channels.
|
|
33
|
+
- **Capability configured status drift:** low. The capability now reports configured when either the instance program or cycle store is wired, matching the fact that cycle routes can be alive independently of the instance object in tests and boot wiring.
|
|
34
|
+
- **Template guidance becoming stale:** medium over time. This is mitigated by listing the same enum values exported by the store today and keeping the text concise.
|
|
35
|
+
|
|
36
|
+
## Test evidence
|
|
37
|
+
|
|
38
|
+
Focused verification:
|
|
39
|
+
|
|
40
|
+
- `npx vitest run tests/integration/apprenticeship-routes.test.ts tests/unit/CapabilityIndex.test.ts tests/e2e/apprenticeship-lifecycle.test.ts`
|
|
41
|
+
- Result: 3 files passed, 31 tests passed.
|
|
42
|
+
|
|
43
|
+
Planned final checks before push:
|
|
44
|
+
|
|
45
|
+
- `pnpm lint`
|
|
46
|
+
- `pnpm build`
|
|
47
|
+
- `node dist/cli.js dev:preflight`
|
|
48
|
+
- `pnpm test:smoke`
|
|
49
|
+
|
|
50
|
+
## Rollback cost
|
|
51
|
+
|
|
52
|
+
Rollback is a normal code revert. Reverting restores the previous permissive HTTP behavior, removes the capability endpoint entries, and removes the new generated/migrated awareness line. No database migration is introduced, and no existing cycle rows need transformation.
|