Skip to content

Commit f89812e

Browse files
claude[bot]claude
andauthored
docs(cli,core): attribute unpack-time integrity re-verification to the future runtime loader, not the cloud control plane (#16826)
* docs(cli,core): name the future runtime loader as the unpack-time integrity re-verification owner Five source comments still said unpack-time `manifest.integrity` re-verification was the cloud control plane's obligation. That attribution was corrected in `packages/spec/src/kernel/manifest.zod.ts`, so the repo stated both things at once. Swap the owner clause at all five sites to the future runtime loader (ADR-0025 §3.5 steps 4-7), keeping the `#11331` pointer and the true build/preflight half. Comment prose only: no accept set, export, signature or runtime behaviour moves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8 * docs(cli,core): keep the corrected owner phrase on one line at every site Two of the five rewritten comments wrapped `future runtime loader` across a line break, which re-creates the exact hazard this change is about: a line-matching grep for the phrase answers "3 sites", and "none left" is indistinguishable from "already fixed". Pure re-wrap of lines this branch already rewrote; no wording changes. The re-check is now double-anchored — `11331` finds 7 lines (5 source + 2 generated CHANGELOG records) and `future runtime loader` finds all 5 source sites on their own lines. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 86c75f4 commit f89812e

5 files changed

Lines changed: 36 additions & 14 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@objectstack/cli": patch
3+
"@objectstack/core": patch
4+
---
5+
6+
Five source comments in `@objectstack/cli` and `@objectstack/core` stop attributing unpack-time `manifest.integrity` re-verification to the cloud control plane and name the owner this repo has already ruled: the **future runtime loader** (ADR-0025 §3.5 steps 4–7). The enforce leg stays tracked on #11331.
7+
8+
`packages/spec`'s `manifest.zod.ts` was corrected to that owner in an earlier change, and these five sites were left behind — so the repo stated both things at once. A comment that names the wrong owner costs nobody a build, but it teaches a reader (and a reading AI) to expect a verification that no component performs and that ADR-0025's own status line records as unimplemented.
9+
10+
- `packages/cli/src/utils/osplugin.ts` — the `.osplugin` packaging docblock, and the `sriDigest` TSDoc.
11+
- `packages/cli/src/commands/plugin/publish.ts` — the integrity-preflight comment.
12+
- `packages/core/src/security/index.ts` — the `verifyIntegrity` export comment.
13+
- `packages/core/src/security/plugin-artifact-integrity.ts` — the verifier's own module docblock, which had explained the module's byte-for-byte portability *by* the wrong owner. It now explains it by the leg itself: the module stays portable to whatever runs unpack-time re-verification.
14+
15+
**What does NOT change.** The other half of every one of these comments — the digest map is computed by `os plugin build` and self-checked by the `os plugin publish` preflight — is true and is kept verbatim. No accept set, export, signature or runtime behaviour moves; the diff is comment prose only.
16+
17+
**What moves for consumers, measured on the built output.** `@objectstack/cli` ships `dist/`, and the `sriDigest` TSDoc rides into `dist/utils/osplugin.d.ts`, so an editor's hover on `sriDigest` stops naming the control plane. `@objectstack/core`'s two sites do **not** reach its published bundle — a module docblock and a line comment above an `export {}` are both dropped from `dist/index.d.ts` — so nothing in that package's shipped bytes moves. It is declared here anyway because the pre-correction attribution is quoted in `packages/core/CHANGELOG.md`, a generated record that may not be hand-edited; a changeset naming the package is the only way the correction reaches that published record.

packages/cli/src/commands/plugin/publish.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ export default class PluginPublish extends Command {
113113
// bytes against the manifest's own declared per-file digests before
114114
// upload. Absent map = permissive by contract (the field is
115115
// `.optional()`; artifacts built before integrity computation stay
116-
// publishable). Unpack-time re-verification remains the cloud control
117-
// plane's obligation (#11331) — this preflight does not discharge it.
116+
// publishable). Unpack-time re-verification is owned by the
117+
// future runtime loader (ADR-0025 §3.5 steps 4–7), not by the cloud
118+
// control plane (#11331) — this preflight does not discharge it.
118119
const declaredIntegrity = manifest.integrity;
119120
if (
120121
declaredIntegrity !== undefined && declaredIntegrity !== null

packages/cli/src/utils/osplugin.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
* The control plane (cloud) stores this blob opaquely. The per-file
1717
* `integrity` map is computed here at build time and self-checked by the
1818
* `os plugin publish` preflight; re-verification at install/load-time
19-
* unpack (ADR §3.5 step 5) is the cloud control plane's obligation and is
20-
* not implemented in this repo (#11331). This module owns the two
21-
* contracts the runtime and cloud must agree on byte-for-byte:
19+
* unpack is not implemented in this repo and is owned by the
20+
* future runtime loader (ADR-0025 §3.5 steps 4–7), not by the cloud
21+
* control plane (#11331). This module owns the two contracts the
22+
* runtime and cloud must agree on byte-for-byte:
2223
*
2324
* 1. The integrity digest STRING FORMAT — Subresource-Integrity style
2425
* `sha256-<base64>` (matches ADR-0025 §3.2's example). See
@@ -43,8 +44,9 @@ export interface ArchiveFile {
4344
* Subresource-Integrity-style digest of `bytes`: `sha256-<base64>`.
4445
* This is the canonical per-file integrity string written into the
4546
* compiled manifest's `integrity` map and checked back at the
46-
* `os plugin publish` preflight (unpack-time re-verification is the
47-
* cloud control plane's obligation, #11331).
47+
* `os plugin publish` preflight (unpack-time re-verification is owned
48+
* by the future runtime loader — ADR-0025 §3.5 steps 4–7 — not by the
49+
* cloud control plane, #11331).
4850
*/
4951
export function sriDigest(bytes: Uint8Array): string {
5052
return 'sha256-' + createHash('sha256').update(bytes).digest('base64');

packages/core/src/security/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ export {
3636

3737
// Per-file artifact integrity verification (ADR-0025 §3.2) — pure and
3838
// portable like the signature contract above; consumed by the
39-
// `os plugin publish` preflight. Unpack-time re-verification stays the
40-
// cloud control plane's obligation (#11331).
39+
// `os plugin publish` preflight. Unpack-time re-verification is owned by
40+
// the future runtime loader (ADR-0025 §3.5 steps 4–7), not by the cloud
41+
// control plane (#11331).
4142
export {
4243
verifyIntegrity,
4344
formatIntegrityViolation,

packages/core/src/security/plugin-artifact-integrity.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
* `integrity` map (artifact-relative path → SRI-style `sha256-<base64>`
88
* digest, the format `os plugin build` writes). Like its sibling
99
* `plugin-artifact-signature.ts`, this module is pure and dependency-free
10-
* (node:crypto only) so it stays byte-for-byte portable to the cloud
11-
* control plane, which owes the unpack-time re-verification leg
12-
* (ADR-0025 §3.5 step 5 — tracked on #11331, NOT discharged by this
13-
* module). The framework caller is the `os plugin publish` preflight: the
14-
* publisher self-checks its own artifact before upload.
10+
* (node:crypto only) so it stays byte-for-byte portable to whatever runs
11+
* the unpack-time re-verification leg — the future runtime loader
12+
* (ADR-0025 §3.5 steps 4–7), not the cloud control plane (tracked on
13+
* #11331, NOT discharged by this module). The framework caller is the
14+
* `os plugin publish` preflight: the publisher self-checks its own
15+
* artifact before upload.
1516
*
1617
* Verdict semantics:
1718
* - absent map (`undefined` / `null`) → ok, `skipped: true` — the field

0 commit comments

Comments
 (0)