Skip to content

Commit d994002

Browse files
docs: the docs and spec comments describe trackHistory by the field-history model (#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 #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 #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 #38064 wording). - N3 (folded spellings), checked and not built: since PR #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 #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>
1 parent c06dac7 commit d994002

10 files changed

Lines changed: 31 additions & 14 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the system-module and security-context comments stop listing field `trackHistory` as part of the audit authoring surface
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Two source comments in `packages/spec/src/system` described the live audit path as "always-on capture + object/field `trackHistory`". A field's `trackHistory` only opts a media or structured-JSON type into old → new values on the record activity timeline, and its `false` turns nothing off; capture is always on whatever either flag says. The comments now name the object's `enable.trackHistory` as what opens the ledger's view on the record page (and the `history` verb), and say that field-change values on the activity stream are `fieldHistory`'s. The generated security-context reference page follows.
11+
12+
Comments only: no schema, no accepted key and no refusal changes. Nothing to migrate.

‎content/docs/concepts/metadata-driven.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ export const Account = ObjectSchema.create({
484484
fields: { /* ... */ },
485485

486486
enable: {
487-
trackHistory: true, // Enable field history tracking
487+
trackHistory: true, // Show the audit ledger's field changes on the record page
488488
searchable: true, // Include in global search
489489
apiEnabled: true, // Expose object via automatic APIs (REST)
490490
files: true, // Enable file attachments

‎content/docs/data-modeling/field-types.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ These properties are available on **all** field types:
10601060
| `defaultValue` | `any` | — | Default value for new records |
10611061
| `group` | `string` | — | Field grouping / section |
10621062
| `inlineHelpText` | `string` | — | Inline help tooltip |
1063-
| `trackHistory` | `boolean` | — | Render this field's value changes as entries on the record activity timeline |
1063+
| `trackHistory` | `boolean` | — | Opt a media or JSON field into old → new values on the record activity timeline; other fields show them already, and `false` does not hide them (that is `fieldHistory: false`) |
10641064
| `requiredPermissions` | `string[]` | — | Capabilities required to read/edit this field (masked on read, denied on write) |
10651065
| `dependsOn` | `string[]` | — | Fields whose values scope this field's options (lookup candidate query; select/radio option gating) |
10661066
| `visibleWhen` | `Expression` | — | Show field only when predicate is true |

‎content/docs/data-modeling/objects.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Control which platform features are active for this object:
7878

7979
```typescript
8080
enable: {
81-
trackHistory: true, // Field history tracking for audit
81+
trackHistory: true, // Show the audit ledger's field changes on the record page
8282
searchable: true, // Include in global search index
8383
apiEnabled: true, // Expose object via automatic APIs (REST)
8484
apiMethods: ['get', 'list', 'create', 'update', 'delete', 'bulk'],
@@ -91,7 +91,7 @@ enable: {
9191

9292
| Flag | Default | Description |
9393
| :--- | :--- | :--- |
94-
| `trackHistory` | `false` | Field history tracking for audit compliance |
94+
| `trackHistory` | `false` | Show the compliance ledger's field changes on the record page and allow the `history` verb. Every write is recorded either way, and a changed field's old → new values show on the activity stream without it — that is `fieldHistory` |
9595
| `fieldHistory` | — (on) | Field-change values (`old → new`) on the activity stream; `false` turns them off for the object |
9696
| `searchable` | `true` | Index records for global search |
9797
| `apiEnabled` | `true` | Expose object via automatic APIs |

‎content/docs/data-modeling/schema-design.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Control which features are available for an object:
6565

6666
```typescript
6767
enable: {
68-
trackHistory: true, // Track field changes over time
68+
trackHistory: true, // Show the audit ledger's field changes on the record page
6969
searchable: true, // Include in global search
7070
apiEnabled: true, // Expose object via automatic APIs (REST)
7171
apiMethods: [ // Whitelist API operations — six primitives only;

‎content/docs/protocol/objectql/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ name: customer
8686
label: Customer
8787
icon: standard:account
8888
enable:
89-
trackHistory: true # Track field history
89+
trackHistory: true # Show the audit ledger's field changes
9090
searchable: true # Global search indexing
9191
apiEnabled: true # Expose object via automatic APIs
9292
fields:

‎content/docs/protocol/objectql/schema.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ The `enable` object controls which features are active:
236236
```yaml
237237
enable:
238238
# Data Management
239-
trackHistory: true # Track field history (who changed what, when)
239+
trackHistory: true # Show the audit ledger's field changes (who changed what, when)
240240
searchable: true # Index for global search
241241
# API & Integration
242242
apiEnabled: true # Generate REST endpoints
@@ -251,11 +251,11 @@ enable:
251251
```
252252
253253
**Performance Impact:**
254-
- `trackHistory: true` adds write overhead (additional inserts to audit table)
254+
- `trackHistory: true` adds no write overhead: the audit ledger records every write either way, and the flag only shows its field changes on the record page
255255
- `searchable: true` adds search indexes (storage overhead)
256256

257257
**When to enable:**
258-
- **trackHistory:** Regulated industries, compliance requirements
258+
- **trackHistory:** Users must read who changed which field, and when, on the record page (regulated industries, compliance reviews)
259259
- **searchable:** User-facing search features
260260

261261
## Field Definition

‎content/docs/references/system/security-context.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ the four independent security subsystems it was designed against. Three of
1313
the four have since been REMOVED per ADR-0056 D8 (declared-but-never-enforced;
1414
see system/index.ts notes) — only encryption survives, marked experimental:
1515
- **Audit** (`audit.zod.ts` — REMOVED): the live audit path is plugin-audit's
16-
always-on capture + object/field `trackHistory` + lifecycle `audit` retention
16+
always-on capture (an object's `enable.trackHistory` shows its field
17+
changes on the record page) + lifecycle `audit` retention
1718
- **Encryption** ([encryption.zod.ts](/docs/references/system/encryption)): Field-level encryption and key management
1819
- **Compliance** (`compliance.zod.ts` — REMOVED): GDPR/HIPAA/SOX/PCI-DSS configs
1920
- **Masking** (`masking.zod.ts` — REMOVED): PII data masking and tokenization

‎packages/spec/src/system/index.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ export * from './stack-server.zod';
4242
// D8 "design+enforce or remove": the whole module had zero consumers — the LIVE
4343
// audit path (plugin-audit) captures unconditionally via engine hooks and defines
4444
// its own sys_audit_log row shape, and `AuditConfigSchema.enabled` contradicted
45-
// the always-on compliance-ledger contract (object.zod `trackHistory`). The
46-
// enforced authoring surface is object/field `trackHistory` + the object
47-
// `lifecycle` `audit` category (retention), with per-org overrides in settings.
45+
// the always-on compliance-ledger contract (object.zod `enable.trackHistory`:
46+
// capture is always on, the flag only opens the ledger's view). The enforced
47+
// authoring surface is the object's `enable.trackHistory` (the record page's
48+
// ledger view and the `history` verb) + the object `lifecycle` `audit` category
49+
// (retention), with per-org overrides in settings. Field-change values on the
50+
// activity stream are `fieldHistory`'s, not part of this surface.
4851
export * from './logging.zod';
4952
export * from './metrics.zod';
5053
export * from './tracing.zod';

‎packages/spec/src/system/security-context.zod.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import { z } from 'zod';
1414
* the four have since been REMOVED per ADR-0056 D8 (declared-but-never-enforced;
1515
* see system/index.ts notes) — only encryption survives, marked experimental:
1616
* - **Audit** (audit.zod.ts — REMOVED): the live audit path is plugin-audit's
17-
* always-on capture + object/field `trackHistory` + lifecycle `audit` retention
17+
* always-on capture (an object's `enable.trackHistory` shows its field
18+
* changes on the record page) + lifecycle `audit` retention
1819
* - **Encryption** (encryption.zod.ts): Field-level encryption and key management
1920
* - **Compliance** (compliance.zod.ts — REMOVED): GDPR/HIPAA/SOX/PCI-DSS configs
2021
* - **Masking** (masking.zod.ts — REMOVED): PII data masking and tokenization

0 commit comments

Comments
 (0)