Repository navigation
Commit 81043c8
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
263 | 267 | | |
264 | 268 | | |
265 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
0 commit comments