Repository navigation
fix(spec): retired-key refusals prescribe the field-history model, not trackHistory - #38064
Conversation
…t trackHistory The enable.trash, versioning, audit and auditTrail refusals sent authors to per-field trackHistory for field history. Values show by default; the object's off switch is enable.fieldHistory: false and a field's is its own fieldHistory: false. The two object tombstones share one sentence, and each new sentence is pinned with a no-trackHistory guard and a cross-check against resolveFieldHistory. Claude-Session: https://claude.ai/code/session_01L9qibybKQ9ZAg8zN9fVBEN Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 5 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f58148ca242236b42cbf4eca2ab6db89fa0006a2 && git checkout f58148ca242236b42cbf4eca2ab6db89fa0006a2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 447757d051446c3826158153f48b52b5a24d1e55 d2313e1dc9960c077454e895ef2ff1c8762da869 && git checkout -B drift-repro 447757d051446c3826158153f48b52b5a24d1e55 && git merge --no-ff d2313e1dc9960c077454e895ef2ff1c8762da869
node scripts/docs-audit/affected-docs.mjs --json 447757d051446c3826158153f48b52b5a24d1e55
|
|
repo:objectstack#3 · os-tesla · session_01L9qibybKQ9ZAg8zN9fVBEN Final head: CI on that head, read from the check-runs endpoint at 2026-11-28 01:10Z: 69 check runs, 58 success, 11 skipped, 0 failed, 0 pending. All eleven required contexts are success ( The Docs Drift Check comment lists |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 396a54f · 2026-11-28T01:12Z L1-a (the seat's L1 thread) runs the isolated |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Inputs read: card #36776 with its three comments (triage 7114582275, claim 7230446042, os-dev report 7231083102), the PR body and its three comments, the net diff against ① Derived judgments
② Semver level
Changeset prose, sentence by sentence against the tree: the account of field ③ Boundary flags
④ Design judgmentRead against True as written:
Findings: S1 (should-fix) — S2 (should-fix) — card done-when 2 is not met, while the PR says Nits (no effect on the contract, accepted as deviations or a follow-up):
Pins: each new refusal sentence is pinned and goes red on the old text, by reading. No must-fix. S1 and S2 are open on this head. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 The filled brief the record above was rendered from (L1-a, isolated Contract review brief — PR #38064 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1 REWORK at What holds.
Owed before ACCEPT.
Nits (not blocking).
Follow-ups for the seat (not this PR). These in-repo texts still prescribe
The fix head owes a same-reviewer delta. |
…eedTracked with fieldHistory The shared enable.trash / versioning prescription said field history needs no key; a media or structured-JSON field shows values only with fieldHistory: true, so the sentence now says so and the cross-check pins the opt-in. The trackChanges and feedTracked field spellings renamed onto trackHistory, whose false turns nothing off; they now take the tracked answer (both stay refused). Claude-Session: https://claude.ai/code/session_01L9qibybKQ9ZAg8zN9fVBEN Co-authored-by: Claude <noreply@anthropic.com>
…6 changeset Claude-Session: https://claude.ai/code/session_01L9qibybKQ9ZAg8zN9fVBEN Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibybKQ9ZAg8zN9fVBEN New head: CI on that head, read from the check-runs endpoint at 2026-11-28 02:49Z: 73 check runs, 60 success, 13 skipped, 0 failed, 0 pending. Every required context is success ( The red |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 9978932 · 2026-11-28T02:51Z |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Delta record. It covers the two fix commits ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentS1: closed
New in the fix, a nit only:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a delta: ACCEPT at
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head d2313e1 · 2026-11-28T03:33Z |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Merge-main record. This head merges main ① Derived judgments
② Semver levelUnchanged and still right: ③ Boundary flags
④ Design judgmentS1: closed Nothing main brought in changes what the six refusal texts say or when they are shown. The accepted nits N1 and N3 stand as recorded. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a: ACCEPT at
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T03:37Z · zone
|
…istory model (objectstack-ai#38238) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoUmHUYZvTYLKjq2dHpiHW6x)_ Part of objectstack-ai#38154 repo:objectstack#3 · os-tesla · session_01L9qibwWRQzuBbuvfHQMtYc Clause-②: no Metadata-protocol: none ## 维护者速读 - 读数据建模文档、协议页和规范注释的搭建者和 AI,现在读到的是对的字段历史说法:字段改动的新旧值默认就显示,对象上的那个开关只管在记录页显示审计台账;以前这些页把它讲成「开了才有字段历史」。 - 接上一张已合入的卡(拒收提示已改成同一说法),替照文档写配置的人和 AI 解决被文档指错开关的问题。 - 只改文档和注释文字,平台行为完全不变;说法若有误,最多是文档不准,可以直接撤回。 - 无 ## What changes - Docs, each sentence restated in the model `resolveFieldHistory` enforces (the refusals merged in PR objectstack-ai#38064 say the same): - `content/docs/data-modeling/field-types.mdx`: the field `trackHistory` row now says it opts a media or JSON field into old → new values, that other fields show them already, and that `false` does not hide them (`fieldHistory: false` does). - `content/docs/data-modeling/objects.mdx` (code comment and the `enable` table row), `content/docs/data-modeling/schema-design.mdx`, `content/docs/protocol/objectql/index.mdx`, `content/docs/concepts/metadata-driven.mdx`: object `enable.trackHistory` is glossed as showing the audit ledger's field changes on the record page, not as "field history tracking". The `objects.mdx` row adds the `history` verb and says that every write is recorded either way and that values on the activity stream are `fieldHistory`'s. - `content/docs/protocol/objectql/schema.mdx`: the same gloss on the `enable` example; the "Performance Impact" bullet no longer says `trackHistory: true` adds inserts to the audit table (the ledger records every write either way); the "When to enable" bullet says what it shows. - Spec comments: `packages/spec/src/system/index.ts` and the `security-context.zod.ts` module docblock no longer list field `trackHistory` as part of the audit authoring surface. They name the object's `enable.trackHistory` (ledger view, `history` verb) beside the lifecycle `audit` retention, and say that field-change values are `fieldHistory`'s. - `content/docs/references/system/security-context.mdx` regenerated from that docblock (`gen:schema` then `gen:docs`; this one file changed). - `@objectstack/spec` patch changeset: the edited `.zod.ts` docblock ships in the package's `files[]`. - No schema, accepted key, refusal or runtime text changes. ## Tests - No test changes: the diff is prose and comments only, and no test pins any of the edited sentences. The regenerated reference page is held by `check:generated` / `check:docs` (readings below). <details><summary>Readings at 92b38c0 (base origin/main 9957484)</summary> - Acceptance grep (the card's): `git grep -n -i "trackHistory" -- content/docs packages/spec/src/system skills/objectstack-project/evals ':!content/docs/releases' ':!content/docs/references'`, filtered for "field history", "history track", "track field", "field-level history", "timeline switch", "object/field": 0 hits in `content/docs` and `packages/spec/src/system`. The one remaining hit is the project skill's eval line, which is PR 2 of this card (below). - Regenerated page diff (`content/docs/references/system/security-context.mdx`): ```diff - **Audit** (`audit.zod.ts` — REMOVED): the live audit path is plugin-audit's - always-on capture + object/field `trackHistory` + lifecycle `audit` retention + always-on capture (an object's `enable.trackHistory` shows its field + changes on the record page) + lifecycle `audit` retention ``` - `pnpm --filter @objectstack/spec build` exit 0 (lock VERDICT command-exit 0). - Derived local gate set at 92b38c0: `dispatch-gates --ran` reconciles 101 derived, 99 run (all exit 0), 2 NOT MEASURED (exit 3), 0 unrun. Five gates first answered PREREQUISITE NOT MET and were re-run after `turbo run build` of `@objectstack/formula`, `@objectstack/lint...`, `@objectstack/objectql`, `@objectstack/client`, `@objectstack/client-react` (47/47 tasks): `check:doc-formula-expressions`, `check:doc-security-posture`, `check:skill-examples`, `check:docs-transcript-drift`, `check:lean-entry-closure`, each exit 0. `check:generated` and `check:docs` exit 0 with the regenerated page. - Left to CI: `check-plugin-teardown-shape.mjs --self-test` (its fixture commit is out of this shallow clone's reach) and `check:dual-build-cjs-loads` (needs a full `pnpm build`; this diff moves no package's build shape). </details> ## Acceptance notes - Scope beyond the card's list, as the claim set it: `protocol/objectql/schema.mdx` "Performance Impact" (false: capture is always on) and "When to enable" bullets, same file and defect class. - Left as they are, by the claim: `content/docs/releases/**` (release history), `content/docs/ui/pages.mdx` (it already describes the object flag's ledger changes in the timeline), `packages/lint/src/rule-explanations.ts` (object meaning, correct), and the generated references other than the regenerated one (already in the objectstack-ai#38064 wording). - N3 (folded spellings), checked and not built: since PR objectstack-ai#38064 no refusal points an author at `trackHistory`. `trackChanges`, `feedTracked` and `tracked` get the `fieldHistory` answer; their case and underscore variants (`trackchanges`, `track_changes`, `FeedTracked`, `Tracked`, …) get only the generic unrecognized-key refusal. Adding guidance for them is runtime refusal text, out of this card. - PR 2 of this card (`Fixes objectstack-ai#38154`), after this one merges: the `skills/objectstack-project/evals/project-process.json` eval id 9 line that still "sets `trackHistory` where field-level history is wanted". ## Verification Read first (by risk): 1. `content/docs/data-modeling/objects.mdx`: the `enable` table's `trackHistory` row (the longest restatement). 2. `content/docs/protocol/objectql/schema.mdx`: the "Performance Impact" bullet. 3. `packages/spec/src/system/index.ts`: the audit-surface comment. Two-minute check: `git grep -n -i "field history track\|track field history\|enable field history" -- content/docs` prints nothing. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibwWRQzuBbuvfHQMtYc)_ Co-authored-by: Claude <noreply@anthropic.com>
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Requested by Tesla · project thread
Fixes #36776
repo:objectstack#3 · os-tesla · session_01L9qibybKQ9ZAg8zN9fVBEN
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/spec/src/data/object.zod.ts:FIELD_HISTORY_PRESCRIPTIONconstant, shared by theenable.trashtombstone (CAPABILITIES_RETIRED_KEY_GUIDANCE.trash) and the top-levelversioningtombstone, so the two cannot drift: "Field history is on by default: a changed field's old → new values show on the record activity timeline, except a media or structured-JSON field, which opts in withfieldHistory: true.enable.fieldHistory: falseturns them off for the object, and a field opts out with its ownfieldHistory: false." Each tombstone keeps its retention half (lifecycle). The constant's docblock namesresolveFieldHistoryandFIELD_HISTORY_DEFAULT_OFF_TYPESas the model it states and says why it never namestrackHistory.activityMilestonesTSDoc no longer callstrackHistory"field-level"; it names the field-change rows and their two off switches.packages/spec/src/data/authoring-key-lint.ts:FIELD_KEY_GUIDANCE.auditand.auditTrailnow say to delete the key, that a changed field's values already show by default, and thatfieldHistory: falseis the field's off switch (fieldHistory: trueopts a media or structured-JSON field in). They no longer send the author totrackHistory.packages/spec/src/data/field-key-aliases.tsandpackages/spec/src/data/field.zod.ts: thetrackChangesandfeedTrackedfield spellings no longer rename ontotrackHistory(whosefalseturns nothing off). The two alias rows are gone, and both keys take the same prose answer as the existingtrackedrow, now built by onefieldHistorySpellingAnswer(key)helper (tracked's text is unchanged). All three keys stay refused..describe()changes.patchchangeset for@objectstack/spec.Tests
packages/spec/src/data/object.test.ts, newdescribe"retired history-promising keys prescribe the field-history model that runs":enable.trashand forversioning: the message carries the default sentence, the default-off exception with itsfieldHistory: trueopt-in, both off switches and the retention half; and it does not containtrackHistory;resolveFieldHistoryagrees with the sentence: a text field on by default,enable.fieldHistory: falseoff, a field'sfieldHistory: falseoff,trackHistory: falsenot an off switch, and ajsonand animagefield off by default and on withfieldHistory: true.versioningneedle moves from'trackHistory'to'fieldHistory'.packages/spec/src/data/authoring-key-lint.test.ts, newdescribeforaudit/auditTrailthroughFieldSchema.safeParse: the refusal carries the three sentences and notrackHistory.packages/spec/src/data/field.test.ts, in the existingtrackeddescribe:trackChangesandfeedTrackedare refused with thefieldHistoryanswer and notrackHistory, andfieldSchemaAliases()has no row for either.Readings at fa487d2 (base origin/main 27ee984); head 9978932 changes only the changeset prose
ObjectCapabilities.safeParse({ trash: false })said "For history use per-fieldtrackHistory(audit trail)…";ObjectSchema.create({ versioning })said "Use per-fieldField.trackHistoryfor field-level history…";FIELD_KEY_GUIDANCE.audit/.auditTrailsaid "UsetrackHistoryfor the activity timeline.";fieldSchemaAliases()renamedtrackChanges/feedTrackedontotrackHistory.scripts/ablation-replace.mjson the committed fix, each restoreblob == HEADandgit diff HEADempty:vitest run src/data/object.test.ts src/data/authoring-key-lint.test.ts:enable.trashold text2 failed;versioningold text3 failed(its two pins and the 16.0 table needle);auditold text2 failed;auditTrailold text2 failed.vitest run src/data/object.test.ts src/data/field.test.ts: the default-off exception removed fromFIELD_HISTORY_PRESCRIPTION2 failed(trash and versioning); thetrackChangesguidance row deleted1 failed; thefeedTrackedrow deleted1 failed; the two alias rows restored2 failed(vitest run src/data/field.test.ts).pnpm --filter @objectstack/spec buildexit 0;check:generatedexit 0 ("All 14 generated artifacts are up to date");typecheckexit 0;test:Test Files 909 passed (909),Tests 28811 passed | 1 todo (28812);eslinton the six changed.tsexit 0.Acceptance notes
dispatch-gates --ranreconciles 93 derived, 92 run, 1 NOT MEASURED, 0 unrun. Two run families exited 1 in the sweep,check:dts-closureandcheck:dual-build-cjs-loads, because an earlierOS_SKIP_DTS=1build in this worktree had left.d.ts-less dists; afterturbo run build --forceof the@objectstack/formula,@objectstack/lintand@objectstack/objectqlclosures both exit 0, as docheck:doc-formula-expressionsandcheck:lean-entry-closure. Left to CI:check-plugin-teardown-shape.mjs --self-test(its fixture commit is out of this shallow clone's reach).audit/auditTrailfield-key refusals and thetrackChanges/feedTrackedrename rows (done-when 2), and theactivityMilestonesTSDoc in the same file.enable.activities: falsewrites no activity row at all, a credential field never shows values, and computed types are never diffed.skills/objectstack-project/evals/project-process.json:145; the docs pagescontent/docs/data-modeling/field-types.mdx:1063,objects.mdx:81,94,schema-design.mdx:68,content/docs/protocol/objectql/schema.mdx:239,index.mdx:89,content/docs/concepts/metadata-driven.mdx:487; and the comments inpackages/spec/src/system/index.ts:45andsecurity-context.zod.ts:17.Verification
Read first (by risk):
packages/spec/src/data/object.zod.ts:FIELD_HISTORY_PRESCRIPTIONand its two uses (thetrashandversioningtombstones).packages/spec/src/data/field.zod.tsandfield-key-aliases.ts:fieldHistorySpellingAnswerand the two alias rows it replaces.packages/spec/src/data/object.test.ts: the new describe and theresolveFieldHistorycross-check.Two-minute check:
pnpm --filter @objectstack/spec exec vitest run src/data/object.test.ts src/data/authoring-key-lint.test.ts src/data/field.test.tsshows every test passing; put "Use per-fieldField.trackHistoryfor field-level history" back into theversioningtombstone and the same command shows 3 failing.Generated by Claude Code