Skip to content

Commit 785d2ea

Browse files
os-zhuangclaude
andauthored
test(dogfood): pin the temporal storage line end-to-end; fail loudly on a mis-scoped docs audit (#4077)
* test(dogfood): pin the temporal storage line end-to-end; fail loudly on a mis-scoped docs audit Two follow-ups from the temporal line, both aimed at the same weakness: a failure that is silent is a failure nobody finds. 1. temporal-storage-e2e.dogfood.test.ts — the four verifications that actually caught #3912/#3928/#3994/#4033, turned into a gate. Every one of those bugs passed its own layer's unit tests: the driver, the strategy and the read path were each internally consistent, and what disagreed was what a value physically IS between them. The symptoms were correspondingly quiet — the list showed the row, the chart drew the bar, only the filtered/sorted/ labelled view was wrong. So the assertions run through the real HTTP write and read path: - a date window returns the rows inside it (the original #3912 report was a dashboard dateRange returning empty), and 23:30Z / 00:30Z keep their UTC calendar day — two instants a naive write path shifts in opposite directions, so either direction is caught regardless of host zone; - a temporal column sorts chronologically both ways, and the two directions must differ (a silently-ignored sort would otherwise pass); - every accepted Field.time input shape converges on one stored wall clock, and an equality filter cannot be split by the writer's spelling; - a timeDimensions bucket reaches the caller with its label. Verified adversarially: reverting #4033's projectedDimensions() turns the analytics case red and nothing else, so the gate tests the seam it claims. The suite deliberately does NOT send epoch milliseconds for a time field. The record validator answers that with 400 invalid_time and should — the driver's epoch handling defends an in-process writer binding a Date, not an API client. That boundary is now pinned too, so the driver's leniency is never mistaken for an accepted wire shape. 2. .claude/workflows/docs-accuracy-audit.js — the scope fallback no longer swallows a caller mistake. `args.docs ?: ALL_HANDWRITTEN` covered both "audit everything" and "your args were malformed", and the Workflow tool delivers args verbatim: passing a JSON-encoded string left args.docs undefined, silently widened a 12-doc request to all 147, and burned ~294 agents with nothing in the output saying the scope had been ignored. Omitting args entirely still means a full audit; supplying an unusable args.docs now throws, and the resolved scope is logged either way. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TPxNwPnjcn599ujXpU3ibJ * fix(dogfood): assert the time-field rejection via the envelope code, not the field-level literal `check-error-code-casing` (ADR-0112 D1) flagged the lowercase 'invalid_time' in a comparison position. The literal is a legitimate D6 field-addressed validator code, so an EXEMPT_FILES entry would have been sanctioned — but the assertion is strictly better without it: the standard SCREAMING envelope code plus the offending field name IS the boundary contract, and pinning the field-level code adds no assurance while costing an exemption the next reader has to interpret. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TPxNwPnjcn599ujXpU3ibJ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8f81731 commit 785d2ea

3 files changed

Lines changed: 303 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
---
3+
4+
test(dogfood): pin the temporal storage line end-to-end; fail loudly on a mis-scoped docs audit
5+
6+
Test/tooling only — no package changes, so this changeset releases nothing.

.claude/workflows/docs-accuracy-audit.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,35 @@ export const meta = {
1313
// scoped subset via args.docs (e.g. only docs whose backing packages/ code changed).
1414
const ALL_HANDWRITTEN = ["content/docs/ai/actions-as-tools.mdx","content/docs/ai/agents.mdx","content/docs/ai/chatbot-integration.mdx","content/docs/ai/index.mdx","content/docs/ai/knowledge-rag.mdx","content/docs/ai/natural-language-queries.mdx","content/docs/ai/skills-reference.mdx","content/docs/ai/skills.mdx","content/docs/api/client-sdk.mdx","content/docs/api/data-api.mdx","content/docs/api/data-flow.mdx","content/docs/api/environment-routing.mdx","content/docs/api/error-catalog.mdx","content/docs/api/error-handling-client.mdx","content/docs/api/error-handling-server.mdx","content/docs/api/index.mdx","content/docs/api/metadata-api.mdx","content/docs/api/plugin-endpoints.mdx","content/docs/api/wire-format.mdx","content/docs/automation/approvals.mdx","content/docs/automation/flows.mdx","content/docs/automation/hook-bodies.mdx","content/docs/automation/hooks.mdx","content/docs/automation/index.mdx","content/docs/automation/webhooks.mdx","content/docs/automation/workflows.mdx","content/docs/concepts/architecture.mdx","content/docs/concepts/design-principles.mdx","content/docs/concepts/index.mdx","content/docs/concepts/metadata-driven.mdx","content/docs/concepts/metadata-lifecycle.mdx","content/docs/concepts/north-star.mdx","content/docs/data-modeling/analytics.mdx","content/docs/data-modeling/drivers.mdx","content/docs/data-modeling/external-datasources.mdx","content/docs/data-modeling/field-type-decision-tree.mdx","content/docs/data-modeling/field-types.mdx","content/docs/data-modeling/fields.mdx","content/docs/data-modeling/formulas.mdx","content/docs/data-modeling/index.mdx","content/docs/data-modeling/indexing.mdx","content/docs/data-modeling/objects.mdx","content/docs/data-modeling/queries.mdx","content/docs/data-modeling/relationships.mdx","content/docs/data-modeling/schema-design.mdx","content/docs/data-modeling/seed-data.mdx","content/docs/data-modeling/validation-rules.mdx","content/docs/data-modeling/validation.mdx","content/docs/deployment/cloud-artifact-api.mdx","content/docs/deployment/environment-variables.mdx","content/docs/deployment/index.mdx","content/docs/deployment/migration-from-objectql.mdx","content/docs/deployment/production-readiness.mdx","content/docs/deployment/publish-and-preview.mdx","content/docs/deployment/single-project-mode.mdx","content/docs/deployment/troubleshooting.mdx","content/docs/deployment/vercel.mdx","content/docs/getting-started/cli.mdx","content/docs/getting-started/common-patterns.mdx","content/docs/getting-started/examples.mdx","content/docs/getting-started/glossary.mdx","content/docs/getting-started/index.mdx","content/docs/getting-started/quick-reference.mdx","content/docs/getting-started/quick-start.mdx","content/docs/getting-started/validating-metadata.mdx","content/docs/index.mdx","content/docs/kernel/architecture.mdx","content/docs/kernel/cluster.mdx","content/docs/kernel/contracts/auth-service.mdx","content/docs/kernel/contracts/cache-service.mdx","content/docs/kernel/contracts/data-engine.mdx","content/docs/kernel/contracts/index.mdx","content/docs/kernel/contracts/metadata-service.mdx","content/docs/kernel/contracts/storage-service.mdx","content/docs/kernel/events.mdx","content/docs/kernel/index.mdx","content/docs/kernel/runtime-services/audit-service.mdx","content/docs/kernel/runtime-services/data-service.mdx","content/docs/kernel/runtime-services/email-service.mdx","content/docs/kernel/runtime-services/examples.mdx","content/docs/kernel/runtime-services/index.mdx","content/docs/kernel/runtime-services/queue-service.mdx","content/docs/kernel/runtime-services/settings-service.mdx","content/docs/kernel/runtime-services/sharing-service.mdx","content/docs/kernel/runtime-services/storage-service.mdx","content/docs/kernel/runtime-services/versioning.mdx","content/docs/kernel/services-checklist.mdx","content/docs/kernel/services.mdx","content/docs/permissions/access-recipes.mdx","content/docs/permissions/authentication.mdx","content/docs/permissions/authorization.mdx","content/docs/permissions/field-level-security.mdx","content/docs/permissions/index.mdx","content/docs/permissions/permission-metadata.mdx","content/docs/permissions/permission-sets.mdx","content/docs/permissions/permissions-matrix.mdx","content/docs/permissions/profiles.mdx","content/docs/permissions/roles.mdx","content/docs/permissions/sharing-rules.mdx","content/docs/permissions/sso.mdx","content/docs/plugins/adding-a-metadata-type.mdx","content/docs/plugins/anatomy.mdx","content/docs/plugins/development.mdx","content/docs/plugins/index.mdx","content/docs/plugins/packages.mdx","content/docs/protocol/backward-compatibility.mdx","content/docs/protocol/diagram.mdx","content/docs/protocol/index.mdx","content/docs/protocol/knowledge.mdx","content/docs/protocol/objectos/config-resolution.mdx","content/docs/protocol/objectos/error-handling.mdx","content/docs/protocol/objectos/http-protocol.mdx","content/docs/protocol/objectos/i18n-standard.mdx","content/docs/protocol/objectos/index.mdx","content/docs/protocol/objectos/lifecycle.mdx","content/docs/protocol/objectos/metadata-service.mdx","content/docs/protocol/objectos/plugin-spec.mdx","content/docs/protocol/objectos/realtime-protocol.mdx","content/docs/protocol/objectos/runtime-capabilities.mdx","content/docs/protocol/objectql/index.mdx","content/docs/protocol/objectql/query-syntax.mdx","content/docs/protocol/objectql/schema.mdx","content/docs/protocol/objectql/security.mdx","content/docs/protocol/objectql/state-machine.mdx","content/docs/protocol/objectql/types.mdx","content/docs/protocol/objectui/actions.mdx","content/docs/protocol/objectui/concept.mdx","content/docs/protocol/objectui/index.mdx","content/docs/protocol/objectui/layout-dsl.mdx","content/docs/protocol/objectui/record-alert.mdx","content/docs/protocol/objectui/widget-contract.mdx","content/docs/releases/implementation-status.mdx","content/docs/releases/index.mdx","content/docs/releases/v9.mdx","content/docs/ui/apps.mdx","content/docs/ui/create-vs-edit-form.mdx","content/docs/ui/dashboards.mdx","content/docs/ui/doc-pages.mdx","content/docs/ui/field-grouping-and-order.mdx","content/docs/ui/forms.mdx","content/docs/ui/index.mdx","content/docs/ui/pages.mdx","content/docs/ui/public-data-collection.mdx","content/docs/ui/role-based-interfaces.mdx","content/docs/ui/setup-app.mdx","content/docs/ui/views.mdx"]
1515

16-
const DOCS = (args && Array.isArray(args.docs) && args.docs.length) ? args.docs : ALL_HANDWRITTEN
16+
// Scope resolution. Omitting `args` entirely is the legitimate "audit
17+
// everything" invocation; supplying `args` but not a usable `args.docs` array
18+
// is a CALLER BUG and must say so.
19+
//
20+
// This used to be a single `?:` that fell back to ALL_HANDWRITTEN for both
21+
// cases. The Workflow tool delivers `args` verbatim, so passing a JSON-encoded
22+
// STRING instead of an object — an easy mistake, and one the tool's own docs
23+
// warn about — left `args.docs` undefined, the ternary silently widened a
24+
// 12-doc request to all 147, and the run burned ~294 agents on work nobody
25+
// asked for. Nothing in the output said the scope had been ignored. Failing
26+
// loudly costs one retry; failing quietly cost an hour.
27+
if (args !== undefined && args !== null) {
28+
if (typeof args === 'string') {
29+
throw new Error(
30+
'[docs-accuracy-audit] `args` arrived as a string, not an object — pass a real JSON ' +
31+
'value (e.g. {"docs": ["content/docs/a.mdx"]}), not a JSON-encoded string. ' +
32+
'Refusing to silently audit all ' + ALL_HANDWRITTEN.length + ' docs instead.',
33+
)
34+
}
35+
if (args.docs !== undefined && (!Array.isArray(args.docs) || args.docs.length === 0)) {
36+
throw new Error(
37+
'[docs-accuracy-audit] `args.docs` must be a non-empty array of doc paths; got ' +
38+
JSON.stringify(args.docs) + '. Omit `args` entirely to audit all ' +
39+
ALL_HANDWRITTEN.length + ' hand-written docs.',
40+
)
41+
}
42+
}
43+
const DOCS = args && Array.isArray(args.docs) && args.docs.length ? args.docs : ALL_HANDWRITTEN
44+
log(`scope: ${DOCS.length} doc(s)${DOCS === ALL_HANDWRITTEN ? ' — FULL audit (no args.docs given)' : ''}`)
1745

1846
const PACKAGE_MAP = `ObjectStack is a metadata-driven application framework. Implementation lives in packages/:
1947
- packages/spec — Zod schemas for every metadata type (.zod.ts); source of truth for shapes & enums. Also packages/spec/src/{data,ui,...}.

0 commit comments

Comments
 (0)