Skip to content

Commit 81043c8

Browse files
docs(agents): PD12 names the load posture for bodies already published or stored (#39697)
Fixes #39307 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:这是写给开发智能体的内部规则,只改总规则文件里"契约优先"一条,补一句"已发布内容在加载时怎么处理"。 - 为什么做:落实你在 HotCRM 预发环境应用消失事件上的裁决(收紧的流程规则对已发布内容只警告不拒绝),否则智能体照旧规则读会把这条裁决改回去。 - 出错会怎样:只是规则文字,不改任何运行行为;这句只管已发布应用包的读取和流程启用,数据库里普通元数据的读取照旧只记诊断、不丢弃;不对可以直接撤回这一句。 - 要你做什么:无;你已同意把规则文件的字节上限按实测抬高 338 字节,本单同步改了上限。 ## What changes Prime Directive 12 gains one sentence, inserted before its closing "Strengthens #5.": > The artifact package reader and flow arming/resume load published or stored bodies past only `AT_REST_TOLERATED_RULES`, a finding each, which writes (save, publish, `os validate`) refuse; every other error refuses, structural ones included (ruling record 7372216489). Generic stored-row reads diagnose, never drop (ADR-0087's 2026-07-31 addendum). - **Two postures, named.** Writes (save, publish, `os validate`) refuse every rule, the tolerated set included. Every parse outside `parseAtRest` is strict. The doors that read a body already published or stored at the `'at-rest'` posture load it past only the rules of the set, each with a finding, and still refuse every other error, structural ones included. - **Which doors.** The artifact package reader is `resolveArtifactPackageEntries` / `resolveArtifactPackageOrder` in `packages/core/src/artifact-packages.ts`, which take a required `{ posture }`. Flow arming and resume are the automation engine's `canonicalizeFlow(..., { posture: 'at-rest' })` in `packages/services/service-automation`. `packages/spec/src/automation/at-rest-tolerance.ts` draws the same line: the addendum "already holds that line for rows entering the registry; this module carries it to the artifact door and to the automation engine's arming". - **What it leaves alone.** The generic stored-row read (`loadMetaFromDb`, the objectql registry) keeps ADR-0087's 2026-07-31 addendum: it diagnoses under `[metadata_spec_invalid]`, registers the row and never drops it. PD12 now says so instead of citing that addendum for the opposite. - **The set, by name only.** `AT_REST_TOLERATED_RULES` lives in `packages/spec/src/automation/at-rest-tolerance.ts` and is exported from `@objectstack/spec/automation`. Its module header holds "nothing joins without a ruling". PD12 names the set and does not restate its members. - **Paying for the sentence inside the ruled budget.** Two words of PD12 were trimmed with no change in meaning: "When a piece of metadata" became "When metadata", and "only when the spec itself is genuinely wrong" became "only when it is genuinely wrong". Every other word of PD12 is unchanged, the refuse-at-authoring/publish clause included. The ruling, verbatim (comment 7372216489 on the HotCRM staging-outage card, posted by the maintainer's account): > **Maintainer decision (Jack, 2026-12-03 08:23Z, project thread on the HotCRM staging outage):** do it. Rules that tighten flow/metadata shape (#38970, #38871 and their kind) **warn, not refuse**, when reading an already-published package body on load, so a host pin move never drops an installed app. New saves/publishes keep refusing. This also has to cover tenant-authored metadata stored in the database (AI-authored drafts and published items), not just marketplace packages. AGENTS.md's own header bars a ruling date or quotation inside a rule, so the rule text cites the ruling record id and the quotation lives here. ## Byte ceiling: raised by ruling record 7413403390 `check:pm-skill-ratchet` held AGENTS.md at 78712 bytes. `origin/main` is 78710 bytes, and no commit to `main` since the merge base has touched AGENTS.md. This PR lands AGENTS.md at **79050 bytes**, measured with `wc -c` at 06ecc7f: **+338 B over the old ceiling**, +340 against main. The maintainer chose route A, recorded as **ruling record 7413403390** (「A: raise limit +338 (Rec.)」). The `AGENTS.md` row of `CEILINGS` in `scripts/pm/check-skill-line-ratchet.mjs` moves **78712 → 79050 (+338 B)**, exactly the measured delta. The round-3 rewrite also lands at 79050, so the row stays at that value. Its comment cites ruling record 7413403390 under ruling record 6184799323, letter B, as the row's earlier raises do. No other row moved. ## Tests No code changes. Local gates for the diff, derived by `node scripts/pm/dispatch-gates.mjs --commands` at 06ecc7f (37 families), each exit code captured before any pipe: <details><summary>Local gate readings at 06ecc7f</summary> - All 37 exit 0. They include `pnpm check:pm-skill-ratchet`, which prints `✓ check-skill-line-ratchet: AGENTS.md is 79050 bytes (ceiling 79050; headroom 0).` and runs the script's own `--self-test`. Also green: `check:pm-dispatch-gates`, `check:ratchet-remedy-authority`, `check:scripts-symbol-anchors`, `check:pm-governed-prose` and `check:pm-skill-id-lint`. - `dispatch-gates --ran`: 37 derived, 37 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero, every row carrying an exit code). - Outside the derivation: `pnpm check:doc-authoring` exit 0. </details> ## Acceptance notes - The `decision-analysis.md` row of the same `CEILINGS` map belongs to another in-flight card and is untouched here. ## Verification Files to read first: `AGENTS.md` PD12 (the inserted sentence, last four lines of item 12, and the two trimmed phrases); `scripts/pm/check-skill-line-ratchet.mjs`, the `AGENTS.md` row of `CEILINGS` (78712 → 79050, the row comment citing ruling record 7413403390); `packages/spec/src/automation/at-rest-tolerance.ts` (the set and its "joins only by ruling" header). Two-minute check: `pnpm check:pm-skill-ratchet` on this head. Expected: green, with `AGENTS.md is 79050 bytes (ceiling 79050; headroom 0)`. --- _Generated by [Claude Code](https://claude.ai/code/session_01ASNY8VYEJsv7qCYaPgM6nB)_ <!-- signed: repo:objectstack@os-mickey · os-mickey · session_01ASNY8VYEJsv7qCYaPgM6nB --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3c0e8b4 commit 81043c8

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎AGENTS.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,21 @@ See `ui/AGENTS.md` for the app-id / localStorage / auth gotchas.
249249
— the rule still outranks the hook. **A worktree isolates neither the stash nor the build cache** — another
250250
hook (`guard-shared-stash.sh`, `OS_ALLOW_STASH=1`) and the replacements live in Multi-agent discipline below.
251251
12. **Contract-first — fix the metadata, not the runtime.** `packages/spec` is the one contract between metadata
252-
*producers* and the runtime/renderers that *consume* it. When a piece of metadata "doesn't work," ask **first**:
252+
*producers* and the runtime/renderers that *consume* it. When metadata "doesn't work," ask **first**:
253253
*is it spec-compliant? is this the long-term-correct direction?* If the metadata is wrong, fix it at the
254254
**producer** and **reject it at authoring/publish** (validation / lint) so the error surfaces loudly — ⛔ never
255255
add a lenient alias or `??` fallback in a consumer (a node executor, the REST layer, a renderer) to tolerate
256256
off-spec input: one strict contract beats N dialects, and this is an **internal** contract (we own both ends), so
257-
"be liberal in what you accept" does **not** apply. Change the **spec** only when the spec itself is genuinely
257+
"be liberal in what you accept" does **not** apply. Change the **spec** only when it is genuinely
258258
wrong, and then deliberately (edit the Zod schema + migrate). When an alias must be tolerated at all, declare it
259259
as an **ADR-0087 conversion-layer entry** (never a bare `??`, no executor shims) so it is declared, loud, tested,
260260
and *removable on a schedule*. Stored rows: `applyConversionsToStoredItem` replays the chain the installed release
261261
carries, retired entries included; kits age out one major after retiring (ADR-0087 as amended, ruling 6434038284),
262-
so run `os migrate meta --stored --apply` before leaving a release that still converts the row. Strengthens #5.
262+
so run `os migrate meta --stored --apply` before leaving a release that still converts the row. The artifact
263+
package reader and flow arming/resume load published or stored bodies past only `AT_REST_TOLERATED_RULES`, a
264+
finding each, which writes (save, publish, `os validate`) refuse; every other error refuses, structural ones
265+
included (ruling record 7372216489). Generic stored-row reads diagnose, never drop (ADR-0087's 2026-07-31
266+
addendum). Strengthens #5.
263267
13. **An accepted ADR binds until a superseding ADR says otherwise.** Reversing a recorded decision is itself a
264268
decision: it needs a **new ADR** (or an amended status line on the old one), not a changeset that quietly does the
265269
opposite. Before changing behaviour in `docs/adr/`-governed territory, **grep the ADRs for the surface you are

‎scripts/pm/check-skill-line-ratchet.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const CEILINGS = new Map([
144144
['.claude/skills/checklist-author/SKILL.md', 3574],
145145
['.claude/skills/dogfood-verification/SKILL.md', 9513],
146146
['.claude/skills/spec-property-retirement/SKILL.md', 26922],
147-
['AGENTS.md', 78712], // raised 78401 → 78712 (+311 B, the volatile-counts rule less the counts it deleted) by ruling records 7233980615 「没用的统计数字直接删,不同步」 and 7234354812 (option A 「上调上限并删无用计数」) under ruling record 6184799323, letter B; raised 78106 → 78401 (+295 B, the merge-queue speed-budget sentence; 1050 → 1053 lines) by ruling record 7044162186 「抬到 1053,整句写进去」 under ruling record 6184799323, letter B
147+
['AGENTS.md', 79050], // raised 78712 → 79050 (+338 B, PD12's at-rest load-posture sentence) by ruling record 7413403390 「A: raise limit +338 (Rec.)」 under ruling record 6184799323, letter B; raised 78401 → 78712 (+311 B, the volatile-counts rule less the counts it deleted) by ruling records 7233980615 「没用的统计数字直接删,不同步」 and 7234354812 (option A 「上调上限并删无用计数」) under ruling record 6184799323, letter B; raised 78106 → 78401 (+295 B, the merge-queue speed-budget sentence; 1050 → 1053 lines) by ruling record 7044162186 「抬到 1053,整句写进去」 under ruling record 6184799323, letter B
148148
['CLAUDE.md', 273],
149149
]);
150150

0 commit comments

Comments
 (0)