Skip to content

feat(platform-objects): working calendars in Setup — sys_work_calendar and sys_work_calendar_exception (ADR-0157, part 2 of 2) - #35642

Merged
objectstack-fleet[bot] merged 25 commits into
mainfrom
claude/issue-35355-work-calendar-objects-setup
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 25 commits into
mainfrom
claude/issue-35355-work-calendar-objects-setup

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
Fixes #35355
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — the two objects are administrator data kept in Setup; a metadata author reaches a calendar only through the working-day formula functions and the approval escalation, whose own pull requests (#35356, #35357) teach it

维护者速读

用户能看到什么变化:系统管理员在「设置」里多了「工作日历」和「日历例外」两页,可以录每周上班时段、节假日和调休上班日,还能从文件一次导入一整年;新建日历时,时区一栏已预先填好本组织的时区。
为什么做:属于「工作日历」,让按工作日计算的期限认得公司真实的上班日,不再把节假日当成工作日;负责计算的另一半已经合并,这一半补上管理员录入日历的页面。
出错会怎样:若出错,管理员可能存不进合法的时段,或新建日历时时区没有预填、需要手动选择;只新增两页、不改旧数据,可以直接撤回。
要你做什么:两页的十种外语译文是机器翻译、未经母语者审阅,请决定是否安排母语者校对。

席位核对

Pair and release (ADR-0157 D4)

Not released alone; pair #35641/#35642. #35641 (the calendar service, its arithmetic, the three ledger codes and the write hooks) is merged to main. This pull request is retargeted to main and has main merged in twice (b154176724, with the deferred regeneration in 06d62d2d7c; then 5a02bbf6ec, the head), so its diff against main is this half alone. It ships in the same release as #35641, #35356 (the working-day formula functions) and #35357 (the approval escalation's working-time clock), per ADR-0157 D4. The changeset says the same.

Fix round (contract review 7023289876, amendment 7023393749)

  • S1, D7 Setup prefill: closed. The create form opens the calendar's timezone on the organization's zone. schemaDefaultValues (ui/packages/plugin-form/src/schemaDefaults.ts) gains homeTimeZone in its seed context, read from useLocalization().timezone, and seeds a field that is required, text and valueDomain: 'iana_time_zone' with no declared default. That is the branch beside the ADR-0144 D8 rule 4 currency seed. All seven create-seed call sites in the five form containers pass it. An optional zone field is never seeded, because a blank there means "take the parent's" (business unit, organization, job). The author's defaultValue and the caller's record win. The help text, in all eleven locales, now says what happens: the create form opens with the organization's zone, and a create that leaves the field out takes the same zone.
  • S2, tests on the real objects: closed. One new file, packages/rest/src/import-work-calendar-csv.test.ts, beside the exchange-rate precedent. It drives the real SysWorkCalendar and SysWorkCalendarException on a real sqlite engine with installWorkCalendarHooks bound, through the generic create door and the async import door. It covers the four cases:
    1. a create without timezone stores the organization zone, with a CONTROL where an organization with no zone gets 400 VALIDATION_FAILED, timezone required;
    2. a code outside the shape gets 400 VALIDATION_FAILED, code invalid_format;
    3. a second row for the same (calendar, date) gets 409 UNIQUE_VIOLATION, while the same date on another calendar lands;
    4. an exception file names the calendar by code; a day off that carries periods is refused for that row alone (periods invalid_value), and the other two rows land.
  • (a), carried from feat(spec, objectql): working-calendar service, arithmetic and refusal codes (ADR-0157, part 1 of 2) #35641's reviews: closed, and closes N5. The same file holds the update-hook pin on a real engine.
    • Under group: a session in org_a with access to org_b edits a row stored in org_b with { is_default: true, organization_id: 'org_a' }. The hook makes exactly one one-default read, in org_b. org_b holds a default and org_a holds none, so the refusal (is_default invalid_value) shows which organization was read.
    • Under isolated: the same session does not reach the row at all (RECORD_NOT_FOUND, zero reads).
  • (c), optional: done, one line. In packages/objectql/src/work-calendar-service.ts, the first literal of the other-organization default refusal now reads "This calendar names an organization this write does not run in". It no longer assumes the writer works in an organization. No other line changed.
  • N1: closed. The exception's periods help is built from WORK_CALENDAR_PERIODS_HELP (lead sentence plus the one statement of the format). Each locale's bundle joins its lead sentence to its own weekday help.
  • N2: closed. content/docs/ui/apps.mdx lists working calendars under group_configuration and describes both Setup pages after Exchange Rates.
  • N3: accepted as built, unchanged.
  • A calendar stays in its organization (seat ruling before landing, 262cd110b0). This replaces the move-with-Default rule of d0339ffb6c, which is removed. In packages/objectql/src/work-calendar-service.ts, an update whose organization_id differs from the stored row's is refused at the door on organization_id (invalid_value), before any read, on both sys_work_calendar and sys_work_calendar_exception, so no writer can change it. A system writer's payload, and a re-point the tenant wall admits, reach the hook and are refused. Without the wall, the engine drops a non-system caller's organization_id key before the hooks and the rest of the edit lands, with the organization unchanged. The reasons are fixed: "A calendar stays in the organization it was created in; create it in the other organization instead." and "An exception date stays in its calendar's organization." An edit that leaves organization_id out, or repeats the stored one, is judged as before. A predicate update is judged per matched row, because the engine hands the hook each row's stored image. Pins in the same rest file, with a system writer: four calendar moves refused with zero reads (keeps Default, sets Default, no Default, clears the organization), an exception move refused, a predicate update refused on each object, and a CONTROL where an edit that leaves the organization out or repeats it lands on both objects. The move cells now assert 400 VALIDATION_FAILED and the reason sentence (N4). The changeset line and the module note say the new rule.
  • An exception date names a calendar of its own organization (seat ruling, 0ceb0b5c58). On a create, and on an update that carries calendar, the sys_work_calendar_exception hooks read the calendar by id in the exception's organization: the session's on a create (the existing rule), the stored row's on an update. That is one indexed read, for every writer, system writes included. When none comes back the write is refused: 400 VALIDATION_FAILED, calendar invalid_value, with one fixed reason, "An exception date names a calendar of its own organization.", which names no organization, code or id. A calendar of another organization and an id that names no calendar get the same body. A create the hooks cannot read for (its row names an organization other than the session's, or it has no organization outside single) is refused the same way. The import door goes through the same hook, and its bad row is still refused alone. Pins in the rest file: a system writer naming a calendar of another organization is refused on create, on a create that names that organization, and on an update that re-points calendar; an id that names no calendar is refused with a body identical to it, from the engine and from the create door for a member; and a CONTROL where a calendar of its own organization lands on create and on update. The objectql D10 unit case now inserts the calendar its rows name. The finding(objectql): the cascade scan still probes a federated object on its other injected anchors — deleting a business unit answers 400 INVALID_FILTER on showcase_ext_customer.owning_business_unit_id (the family closing card after #7738 and #21910) #21918 guard and the censuses list nothing new: the read is a find by id through the existing elevated read context.
  • The federated disposition (5e806492ca, rekeyed in 262cd110b0). CI's Test Core (4/10) went red on d0339ffb6c in packages/objectql/src/federated-injected-column-readers.test.ts (finding(objectql): the cascade scan still probes a federated object on its other injected anchors — deleting a business unit answers 400 INVALID_FILTER on showcase_ext_customer.owning_business_unit_id (the family closing card after #7738 and #21910) #21918): the move check names organization_id inside installWorkCalendarHooks, and the guard wants a disposition for every such use. The new READERS row is row-value: the hook asks whether the update payload already in hand carries the column, reads no storage, and its object, sys_work_calendar, is a platform object that is never federated. No source change. The local narrowing that missed this (objectql's calendar suite only) is replaced by one run of the whole objectql package, below. In 262cd110b0 the read moves into its own helper, so the row is rekeyed to work-calendar-service.ts#refuseOrganizationChange :: organization_id, still row-value: it compares the payload with the stored row the engine passed the hook, names the column in the refusal, and reads no storage; both objects are platform objects, never federated.

What changes (this half, against main)

  • sys_work_calendar and sys_work_calendar_exception in packages/platform-objects/src/system/: the objects, Setup entries, import door and baselines. These are unchanged from the reviewed head except for the two help texts above.
  • Create form: the time-zone seed (S1), with ui/packages/plugin-form/src/__tests__/organizationZoneSeed-35355.test.tsx. That file has four seeding cases, plus the modal and inline create forms rendering the zone the localization context carries.
  • Translations: the eleven bundles carry the new timezone and periods help. The ten non-English strings are machine-made (written by the agent), not reviewed by native speakers.
  • Merge with main: the additive lists take the sys_unit rows from feat(spec, platform-objects): the standard unit table and the organization unit object sys_unit (ADR-0158 U1-U3) #35581 first, then the two calendar rows. The lists are the plugin's object list, the exports, the nav contributions, the extract config, the ownership inventory, the bundle-ownership list and the locale nav labels. The Setup-tree pin is re-counted to 34 (6 groups, 27 contributions, 1 MCP entry), with both calendar ids named. The census is regenerated (106 registered, 55 in reach). The spec api-surface and export-origins shards regenerate to main's bytes.

Tests

At 0ceb0b5c58 (the exception's calendar), under os-verify-lock, VERDICT command-exit 0 for each:

  • the whole @objectstack/objectql package, both vitest projects, no file filter: Test Files 618 passed (618), Tests 13952 passed (13952);
  • typecheck exit 0 for @objectstack/objectql and @objectstack/rest (tsc --noEmit and check:test-typecheck);
  • rest src/import-work-calendar-csv.test.ts: Tests 14 passed (14), the import case included; with the exchange-rate precedent, Test Files 2 passed (2), Tests 17 passed (17).

At 262cd110b0 (the organization rule), under os-verify-lock, VERDICT command-exit 0 for each:

  • the whole @objectstack/objectql package, both vitest projects (vitest run --maxWorkers=2, no file filter): Test Files 618 passed (618), Tests 13952 passed (13952). It ran at 1f311f091b; 262cd110b0 differs from it by one line in the rest test file, so no objectql file changed;
  • typecheck exit 0 for @objectstack/objectql and @objectstack/rest (tsc --noEmit and check:test-typecheck);
  • rest src/import-work-calendar-csv.test.ts: Tests 11 passed (11); with the exchange-rate precedent, Test Files 2 passed (2), Tests 14 passed (14).

At 5e806492ca (the federated disposition), under os-verify-lock, VERDICT command-exit 0 for each:

  • the whole @objectstack/objectql package, both vitest projects (vitest run --maxWorkers=2, no file filter): Test Files 618 passed (618), Tests 13952 passed (13952). 618 is every test file in the package;
  • objectql src/federated-injected-column-readers.test.ts with src/work-calendar-service.test.ts: Test Files 2 passed (2), Tests 29 passed (29);
  • typecheck exit 0 for @objectstack/objectql (tsc --noEmit and check:test-typecheck);
  • rest src/import-work-calendar-csv.test.ts, after the objectql build: Tests 10 passed (10).

At d0339ffb6c (the move rule), under os-verify-lock, VERDICT command-exit 0:

  • typecheck exit 0 for @objectstack/objectql and @objectstack/rest;
  • objectql src/work-calendar-service.test.ts: Tests 24 passed (24);
  • rest src/import-work-calendar-csv.test.ts with its precedent: Test Files 2 passed (2), Tests 13 passed (13), of which the new file is 10.

d0339ffb6c touches only that hook, that test file and the changeset. The readings below are at a21b8adc1c:

Readings
  • @objectstack/rest, src/import-work-calendar-csv.test.ts with the precedent src/import-exchange-rate-csv.test.ts: Test Files 2 passed (2), Tests 10 passed (10). The new file holds 7 cases: the zone fill and its CONTROL, the code shape, the (calendar, date) key, the import, and the update-hook pin under group and under isolated.
  • ui, packages/plugin-form/src/__tests__/organizationZoneSeed-35355.test.tsx with recordCurrencySeed-27188.test.ts: Test Files 2 passed (2), Tests 10 passed (10).
  • ui, the whole packages/plugin-form/ directory at 03fb5f71cf (the head before the casing fix, which touched only the rest test): Test Files 237 passed, 3 failed (240), Tests 2674 passed, 1 skipped. The 3 files failed at import with Failed to resolve import "@objectstack/client", an unbuilt package in this worktree, and never ran. After building that closure, the 3 files re-ran at a21b8adc1c: Test Files 3 passed (3), Tests 16 passed (16).
  • @objectstack/platform-objects: Test Files 125 passed (125), Tests 2094 passed (2094).
  • @objectstack/objectql, src/work-calendar-service.test.ts: Test Files 1 passed (1), Tests 24 passed (24).
  • @objectstack/cli --project unit, test/connect-agent-both-halves-wire.pin.test.ts (34 entries) with src/utils/organization-ownership-inventory.test.ts: Test Files 2 passed (2), Tests 28 passed (28).
  • Typecheck exit 0 for @objectstack/objectql, @objectstack/platform-objects, @objectstack/rest and @object-ui/plugin-form (type-check). rest and plugin-form first answered exit 2 with TS2307 on unbuilt workspace packages; after building their closures, both re-ran to exit 0.
  • Narrowed, declared: objectql changes one string literal, so only its calendar suite ran locally. At d0339ffb6c that narrowing missed the federated-column guard, which reads objectql's source; the whole objectql package ran at 5e806492ca (above). rest adds one test file, so only that file and its precedent ran. The cli suites are the two files the merge touched. CI's Test Core and Test UI run the full packages.

Ablations

Each leg mutates through an anchor that must hit (scripts/ablation-replace.mjs). Where the test reads dist/, the leg rebuilds and proves the mutation reached it (scripts/ablation-dist-preflight.mjs). It then restores from HEAD and proves the restore: git diff HEAD is empty and the blob equals HEAD; for objectql the leg also rebuilds and checks --absent.

Readings
  • O1, the update hook reads in the session's organization instead of the stored row's (objectql, rebuilt, marker in dist/): Tests 1 failed, 6 passed (7). The one red is the group pin. Restored, blob f4f4d9dca375 equals HEAD, rebuilt, marker absent from dist/.
  • O2, no zone fill on create (objectql, rebuilt, marker in dist/): Tests 4 failed, 3 passed (7). The reds are the zone-fill case and three cases whose fixtures create calendars without timezone, so the fill is load-bearing beyond its own pin. Restored, blob equals HEAD, marker absent.
  • U1, no zone seed (source, no build): Tests 3 failed, 3 passed (6). The reds are the seed case and the modal and inline forms. Restored, blob 8b8f78c9c030 equals HEAD.
  • U2, the seed ignores required (source): Tests 3 failed, 3 passed (6). The optional zone field is seeded, so "only that field" and both form cases go red. Restored, blob equals HEAD.
  • C1, the calendar check never runs (at 0ceb0b5c58; anchor if (!hasOwn(data, 'calendar')) return; made to always return; objectql rebuilt, marker in dist/): Tests 2 failed, 12 passed (14). The reds are the other-organization pin and the identical-body pin; the CONTROL stays green.
  • C2, the calendar read runs unscoped (the read's context loses the organization; rebuilt, marker in dist/): Tests 2 failed, 12 passed (14), the same two pins: a calendar of another organization is found and the write lands. Both legs restored with git checkout HEAD: git diff HEAD empty, blob 4d11c70dfb5d equals HEAD; rebuilt, both markers absent from dist/, tree clean, and the file re-ran 14 passed.
  • M2, the organization refusal never fires (at 262cd110b0; the anchor if (!hasOwn(data, 'organization_id')) return; replaced so it always returns; objectql rebuilt, marker in dist/): Tests 3 failed, 8 passed (11). The reds are the calendar moves, the exception move and the predicate cell; the CONTROL and the other eight stay green. Restored with git checkout HEAD: git diff HEAD empty, blob 9ddf30178b3d equals HEAD, rebuilt, marker absent from dist/, tree clean, and the file re-ran 11 passed.
  • M1, the move refusal never fires (superseded with its rule; at d0339ffb6c; objectql rebuilt, marker in dist/): Tests 2 failed, 8 passed (10). The reds are both move refusals. Restored, blob 674ebe573938 equals HEAD, rebuilt, marker absent, and the file re-ran green (10 passed).

Gates

Readings
  • Derived list (node scripts/pm/dispatch-gates.mjs --commands, tree a21b8adc1c): 132 families, each run with its exit captured before any pipe.
    • 127 answered exit 0 on the first run.
    • 5 answered exit 3, PREREQUISITE NOT MET: check:i18n, check:i18n-coverage, check:i18n-walk-parity, check:dual-build-cjs-loads and check:skill-examples, because client packages were unbuilt in this worktree. After turbo run build --filter='./packages/**', all 5 re-ran to exit 0:
      • check-i18n-bundles: OK (10 package(s) — all bundles in sync, no undeclared authoring keys)
      • check-i18n-coverage: OK (14 config(s), 423 baselined untranslated string(s), none new)
      • check-i18n-stale-fill: OK (11 bundle set(s) — no new stale fills, 1 baselined)
  • Reconciliation: Run reconciliation — 132 derived, 132 run, 0 NOT-MEASURED, 0 UNRUN.
  • At d0339ffb6c: the 50 derived families whose sources include one of that commit's three files re-ran, plus check:adr-anchors, check:adr-symbol-anchors, check:scripts-symbol-anchors, check:error-code-casing and check:nul-bytes. All 55 gave exit 0, after turbo run build --filter='./packages/**'. The union with the run above reconciles again: 132 derived, 132 run, 0 NOT-MEASURED, 0 UNRUN. This narrowing is declared: the other 82 families read only files unchanged since a21b8adc1c. overlap-check against main at 5d2ce34f88: merges cleanly, so main is not merged again; fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223 as before.
  • At 5e806492ca: the 39 derived families whose sources include the one changed test file re-ran after turbo run build --filter='./packages/**'; all 39 gave exit 0. The union reconciles: Run reconciliation — 132 derived, 132 run, 0 NOT-MEASURED, 0 UNRUN. main at a3a74f2702 still merges cleanly (git merge-tree exit 0), so it is not merged.
  • At 0ceb0b5c58: the derived families whose sources include one of this commit's four files, plus check:error-code-casing, check:nul-bytes, check:adr-anchors, check:adr-symbol-anchors and check:scripts-symbol-anchors: 55 families, all exit 0, after turbo run build --filter='./packages/**'. Among them check:system-context-census ("OK — 195 elevation read sites ... the page cites 184 symbol(s) against 184 required") and check:platform-object-tenancy-census. The union reconciles: Run reconciliation — 132 derived, 132 run, 0 NOT-MEASURED, 0 UNRUN. main at c4a73be6be merges cleanly (git merge-tree exit 0), so it is not merged.
  • At 262cd110b0: the derived families whose sources include one of this commit's four files, plus check:error-code-casing, check:nul-bytes, check:adr-anchors, check:adr-symbol-anchors and check:scripts-symbol-anchors: 55 families, all exit 0, after turbo run build --filter='./packages/**'. check:error-code-casing first answered exit 1 at 1f311f091b on a predicate cell's where: { code: ... } literal; the cell now selects by name, and the gate is unchanged. The union reconciles: Run reconciliation — 132 derived, 132 run, 0 NOT-MEASURED, 0 UNRUN. main at ca4ec2a2f1 merges cleanly (git merge-tree exit 0), so it is not merged.
  • Also run: check:error-code-casing exit 0 after the reshape in a21b8adc1c (the CI red on 03fb5f71cf); check-platform-checklist --changed-from origin/main OK (8 anchors judged, 0 lost); check:new-line-citations (ui) 0 new; overlap-check exit 1, for fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223 only (see the acceptance notes).
  • CI check-runs on a21b8adc1c, read once: 61 success, 9 skipped, none failed, none in progress. They include Lint · docs & code guards success, Check Changeset success, and PR-body guards success.
  • CI on d0339ffb6c: Test Core (4/10) failed on the federated-column guard, fixed in 5e806492ca.
  • CI on 5e806492ca: 63 success, 11 skipped, none failed (as the contract review read it).
  • CI on 262cd110b0, read once at 06:11Z right after the push: 1 success, 5 skipped, 19 in progress, none failed.
  • CI on 0ceb0b5c58, read once at 06:49Z right after the push: 20 queued, 4 skipped, none failed. The seat reads them.

Comments read (through 7031651815)

  • 7021772491, the docs drift check. The administrator page this half moves is content/docs/ui/apps.mdx, now updated (N2). The generated reference pages are regenerated, and the docs gate families in the derived list pass.
  • 7022988800, L1-a.
    • R1 (CI green on that head) is superseded by this head.
    • The retarget it asks for is done: the base is main and main is merged in. The merge needed regenerated artifacts (the census), so this head needs the delta L1 it names.
  • 7023289876, the contract review. S1, S2, N1 and N2 are answered item by item in the fix-round section above. N3 stands as accepted.
  • 7029494079, L1-a delta. ACCEPT on a21b8adc1c, with no required item. d0339ffb6c adds the move rule the seat ruled afterwards; the routing it names (contract delta, then landing) is unchanged.
  • 7030929617, L1-a delta. ACCEPT on 5e806492ca; superseded by the seat's ruling that followed, which this head implements.
  • 7031077678, contract delta review. PASS on 5e806492ca. N4: done, the move cells assert 400 and the reason sentence. N5 (claim surface for federated-injected-column-readers.test.ts): closed by the seat's claim amendment, as the landing post records. N6: closed by the ruling; no update changes a calendar's organization any more.
  • 7031106163, 7031135306, 7031141711. The landing post on 5e806492ca, the landing seat's pull-back for this ruling, and the dequeue relay. This head is the one commit the pull-back asks for.
  • 7031651815, merge-queue triage. Queue build 44679664664 failed in packages/qa/dogfood, approval-read-over-mcp.dogfood.test.ts: the MCP query_records description did not name sys_approval_request. That text lives in packages/mcp/src/mcp-http-tools.ts, which this pull request does not touch, and the same signature hit four pull requests in one speculative stack (summary issue Queue-flake anchor: test/approval-read-over-mcp.dogfood.test.ts #35756).

Acceptance notes

  • The seed rule's reach. It keys on required plus valueDomain: 'iana_time_zone', with no new metadata key and no spec change. So it applies to any object's required zone field, as the currency seed applies to any record-currency field. Today the calendar is the only platform object with a required zone field; the business unit, organization and job zones are optional and not seeded.
  • The zone the form reads. It comes from /auth/me/localization, which reads the organization's localization.timezone. That is the setting the server-side fill reads, and its declared default is UTC, so both sides agree when it is unset.
  • Overlap. feat(spec, platform-objects): the standard unit table and the organization unit object sys_unit (ADR-0158 U1-U3) #35581 landed, and the merge above resolves it. fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223 still conflicts textually in the cli Setup-tree pin (overlap-check); whichever lands second re-counts it.
  • Precedent observation, not changed. The exchange-rate import test's execution-context double carries organizationId, a key the data doors do not read as the active organization (tenantId is). The new file uses tenantId, so its writes run in the organization the hooks read.
  • Line count. 2458 changed lines (+2423 -35, 57 files) against the merge base ed906d567a.

Verification

  • Read first:
    1. ui/packages/plugin-form/src/schemaDefaults.ts: the seed rule and its required-only guard.
    2. packages/rest/src/import-work-calendar-csv.test.ts: the update-hook pin's fixture, where org_b holds a default and org_a none.
    3. packages/platform-objects/src/system/sys-work-calendar-exception.object.ts: the periods help built from the shared constant.
  • Two-minute check: pnpm --dir ui exec vitest run packages/plugin-form/src/__tests__/organizationZoneSeed-35355.test.tsx. Expect 6 passed, including the modal and inline forms opening with Asia/Shanghai in Time Zone.

Generated by Claude Code

…ng-calendar arithmetic

ADR-0157 open point 3: zonedWallClockToUtcMs and wallClockToUtcMs move from
@objectstack/core to @objectstack/spec/data (bodies byte-identical; core
re-exports them), and the pure working-time arithmetic over one resolved
calendar lands beside them, so the calendar service and the working-day
formula functions count with one daylight-saving rule (D11). The three
refusal codes are registered in the ADR-0112 ledger.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
…oks and Setup entries

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
…r bundles, and record the baselines they need

The ten translated locales carry hand translations for every new key of
sys_work_calendar and sys_work_calendar_exception; the ownership list,
the organization-ownership inventory, the tenancy census, the ADR anchors,
the spec API surface and the changeset follow the two new objects.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
…s, and the regenerated references

The calendar write door stamps its ADR-0114 field codes as plain literals, one
per branch. The service test's read double refuses an operator it does not
implement, its memory driver honours the caller's limit, and its engine calls
carry typed options. The spec export origins and the API references now list
the working-calendar exports and the three ledger codes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
The admin Setup composition grows from 31 to 33 entries with Working
Calendars and Calendar Exceptions under Configuration; the pin names both.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
…d Setup move to a sibling branch

This branch now carries the first half of the working-calendar change: the
pure arithmetic and the wall-clock primitive in @objectstack/spec/data, the
three ledger codes, the calendar service and its write hooks in
@objectstack/objectql, and the regenerated references. The two calendar
objects, their translations, the Setup entries, the import door, the tenancy
census, the ownership inventory and the Setup-tree pin return to main here
and land on claude/issue-35355-work-calendar-objects-setup. The spec API
surface and export origins are regenerated from the merged tree.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
… objects, their translations, Setup entries and import

sys_work_calendar and sys_work_calendar_exception, modelled on
sys_exchange_rate: organization data an administrator keeps, audited. Setup
gains Working Calendars (with a Needs Maintenance list) and Calendar
Exceptions (with file import); all eleven locales carry the labels and help.
The platform object name list, the organization-ownership inventory, the
tenancy census and the Setup-tree pin follow the two objects. The service,
arithmetic and write door they rely on come from the branch this one is cut
from.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/cli, @objectstack/objectql, @objectstack/platform-objects, @objectstack/spec, touching 59 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/platform-objects/src/system/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

73 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 92ab0564ede92b6620ed281b1395f46f8340ddc3.

⛔ 20 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/platform-objects/src/system/index.ts) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: isSystem (5 routes)
  • 1 anchor(s) matched too much of the corpus to be a work list: organization_id (literal, 41 pages)
  • 8 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 185 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 92ab0564ede92b6620ed281b1395f46f8340ddc3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8cd923282d41650c6083d698892d62c67608a7a2 — the merge of head 5a02bbf6ec34ca501e06c4099a97b9b6d0eee962 into base 92ab0564ede92b6620ed281b1395f46f8340ddc3, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8cd923282d41650c6083d698892d62c67608a7a2 && git checkout 8cd923282d41650c6083d698892d62c67608a7a2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 92ab0564ede92b6620ed281b1395f46f8340ddc3 5a02bbf6ec34ca501e06c4099a97b9b6d0eee962 && git checkout -B drift-repro 92ab0564ede92b6620ed281b1395f46f8340ddc3 && git merge --no-ff 5a02bbf6ec34ca501e06c4099a97b9b6d0eee962

node scripts/docs-audit/affected-docs.mjs --json 92ab0564ede92b6620ed281b1395f46f8340ddc3

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 92ab0564ede92b6620ed281b1395f46f8340ddc3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ays beside the spec's

@objectstack/spec/data now exports isWorkingDay and addWorkingDays, the
platform working-calendar arithmetic. The gantt scheduler's module-local
helpers carry the same two names over the view's own skipWeekends and
holidays calendar, which ADR-0157 keeps until its Follow-up switches the
gantt to the platform calendar. Two reasoned ALLOW entries in the
spec-symbol derivation gate; no gantt behaviour changes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:系统设置里新增"工作日历"和"日历例外日期"两个页面:管理员可以设定每周上班时间、标记默认日历、录入节假日和调休上班日,也可以批量导入;列表里会提示哪些日历快到维护期限。
  • 为什么做:工作日历这张卡的第二半,给上一半的计算提供数据;两半同批上线。
  • 出错会怎样:日历录错会让按工作日算出的期限不对;录入时会拦下跨午夜、时段重叠等明显错误。
  • 要你做什么:无。席位做合同复审;第一半合并后,这一半改成以主干为基础再合并。
  • 席位意见:通过;等检查全部跑完全绿后交席位复审。

席位核对

L1-a: ACCEPT, one item before the L2 · head 320ed52d8829c20f16e3862c204c61a0c5b43ced · Fixes #35355 (PR-B of the split; base claude/issue-35355-work-calendar-objects-service, PR-A #35641) · K=11 against main · merge-tree with main clean · not governed (0 of 45 paths) · 1,806 lines of its own (3,693 cumulative while A is open) · 2026-11-19T21:40Z

Shape. Over PR-A's head there are two commits: c3e3d1be1e (the change) and 320ed52d88 (A's spec-symbol fix merged in). 45 files:

  • the two objects sys_work_calendar and sys_work_calendar_exception in packages/platform-objects/src/system/, with their name constants;
  • 11 *.objects.generated.ts bundles at 123 lines each, plus source hashes and bundle wiring;
  • two SETUP_NAV_CONTRIBUTIONS entries;
  • the tenancy census, the cli ownership inventory and the cli Setup-tree pin;
  • a changeset.

Claim surface: holds. Claim 7013077388 names packages/platform-objects/**, the spec name constant, the Setup page and import, and the generated translations. Amendment 7021881794 adds the census, the inventory and "the cli Setup-tree pin test", which is packages/cli/test/connect-agent-both-halves-wire.pin.test.ts. That pin moves 31 → 33 with a history line and asserts both new nav ids.

Objects.

  • Both are managedBy: 'system-data'. The exception object takes userActions: { import: true }, the generic import door per reading A2, and cascades from its calendar.
  • code is unique per organization and matches WORK_CALENDAR_CODE_PATTERN. timezone is required: true with an IANA value domain. It is filled server-side before validation (see my record on feat(spec, objectql): working-calendar service, arithmetic and refusal codes (ADR-0157, part 1 of 2) #35641), but the Console form will still demand it: the body's acceptance note on open point 6.
  • needs_maintenance reads WORK_CALENDAR_MAINTENANCE_LEAD_DAYS from spec rather than a literal.

R1 (before the L2): CI green on this head. At this reading: 45 success, 11 skipped, and 11 in progress (Test UI 2, 3, 4, 8, 10 and 15 of 16; Test Core 1, 3, 9 and 10 of 10; Type Check · workspace). The PR-body guards ran twice: a failure at 21:18:29Z, before re-claim 7022517146, and a success at 21:24:55Z, which stands.

After PR-A lands. Retarget to main. The re-run CI on that base is the head the L2 and the landing read. If the retarget needs more than a fast merge, for example regenerated api-surface or export-origins because #35581 or #35583 landed first, the new head needs a delta L1.

Routing. Clause-② yes (widening), and the spec name constant is a packages/spec face: L2 at CONTRACT_REVIEW_TIER by seat 5, together with PR-A. Not governed, so data-1 lands it after A. The semver, P4 and release-coupling notes in my #35641 record apply to the pair.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 320ed52d8829c20f16e3862c204c61a0c5b43ced
Local-runs: none
Scope: packages/spec/src/system/constants/platform-object-names.ts + packages/platform-objects/src/system/sys-work-calendar.object.ts, packages/platform-objects/src/system/sys-work-calendar-exception.object.ts, packages/platform-objects/src/plugin.ts, packages/platform-objects/src/system/index.ts, packages/platform-objects/src/apps/setup-nav.contributions.ts, packages/cli/src/utils/organization-ownership-inventory.ts

PR #35642 is half B of card #35355 (ADR-0157), stacked on half A (#35641). This record judges B's own increment: the 45-file diff from A's head ad45d084f4 (the PR base and the merge base) to the head above, the same file list GitHub shows. Half A was read only to check that B's objects agree with the service and write hooks they are judged by. The rest of the diff (tests, the eleven generated bundles and their source-hash files, the locale nav labels, the extract config, the census, the changeset) is the lane seat's ACCEPT; the locale bundles were read for structure only, as asked.

Check-runs on this head as read: 59 success, 11 skipped, 1 failure, none in progress. The failure is the first run of PR-body guards (check:closing-target-claim, before claim 7022517146 named the setup branch); the same check re-ran on this head and succeeded, so no gate is red.

① Derived judgments

  1. PLATFORM_OBJECTS_BY_PACKAGE['platform-objects'] gains sys_work_calendar and sys_work_calendar_exception, in sorted position, so PLATFORM_PROVIDED_OBJECT_NAMES and isPlatformProvidedObjectName answer for both. Right: both files exist under packages/platform-objects/src/system/, which is what the registry's own conformance scan reads.
  2. A stack action whose objectName is either name is now accepted by stack.zod.ts (a platform-prefixed name outside the list is refused there), and the lint ladder resolves a reference to either name. Right, and it is a widening: nothing accepted before is refused.
  3. PlatformObjectsPlugin registers both objects in its first manifest, unconditionally. Every composition gains two tables on the project database, and both vote in resolvePrimaryDatasource beside sys_exchange_rate. Right, additive.
  4. With the objects registered, half A's service stops answering "no calendar object" and its hooks bind to real declarations. Read in engine-insert.ts: defaults, then beforeInsert hooks, then record validation, then validation rules. So the hook's time-zone fill runs before required is judged, and the code format rule and the iana_time_zone domain judge the filled row. Right. Field names agree with what half A reads: code, timezone, is_default, maintained_from, maintained_through, the seven *_periods columns, and calendar, date, kind, periods on the exception.
  5. Data API: both objects are apiEnabled with the system-data affordances (create, edit, delete); import is opened on the exception object alone. Right, the sys_exchange_rate shape.
  6. Accept-sets the objects close: code unique per organization and held to the same pattern string the service tests a named code against; one exception row per (calendar, date) per organization (D10); kind is off or on only, which is the pair the exception hook judges. Right. No stored rows exist, so nothing is narrowed.
  7. Setup gains two group_configuration entries after Exchange Rates, each naming a view its object declares; the Setup-tree pin moves from 31 to 33. Right.
  8. @objectstack/platform-objects exports SysWorkCalendar, SysWorkCalendarException and WORK_CALENDAR_PERIODS_HELP. Additive.
  9. Organization-ownership inventory: two attribution rows, the exception anchored to its calendar through parent('calendar', 'sys_work_calendar'). Right: both tables carry organization_id (census: 105 registered, 54 in reach).
  10. Locales, structure only: each of the eleven *.objects.generated.ts files gains 123 lines with a key skeleton identical to English; the literal tokens (HH:mm-HH:mm, the example periods, 24:00, cn_standard, Asia/Shanghai, 60) occur the same number of times in every locale; the values left identical to English (2 to 5 per locale, none in Arabic) are exactly the rows added to the source-hash files; both nav labels are present in all eleven locale files. Complete. Prose quality is not judged here.

② Semver level

The changeset carries @objectstack/platform-objects minor, @objectstack/spec patch and @objectstack/cli patch, with Clause-②: yes (widening) and Metadata-protocol: added, and the PR body carries the same two lines. That matches what the diff publishes: the protocol change (two new platform object names an author may now reference) takes minor on the package that ships the objects, and the registry and inventory edits are patch. The three packages named are the three released packages the diff moves.

Clause-②: yes (widening) stands on B's own increment (derived judgments 1 and 2); it does not need half A to be true.

③ Boundary flags

Dev flags and open questions that reach this half, each answered:

  • Required maintained_through (open point 2): accepted. D3 says a blank must not read as "no holidays from here on", and a required field is the plainest shape that holds it.
  • Required maintained_from, a field outside D1's list (past-side bound): accepted. Comment 7005998663 puts refusing like D8 inside the ADR and keeps only "covered by the weekly pattern" out of this card's hands; an explicit bound is the refusing choice.
  • Lead time of 60 days: accepted. D8 leaves the distance to this card, and 60 days puts a calendar maintained through 31 December on the list from 1 November.
  • Time-zone prefill server-side only (the report's sixth question): not accepted as built. See S1. The half this review can settle is the object's help text; whether a server-side fill alone meets D7 is a ruled sentence and is escalated to the maintainer.
  • Where the arithmetic lives, and under whose authority the service reads: half A's, not judged here.
  • Files beyond the claimed surface (inventory, census, bundle-ownership list, Setup-tree pin): covered by claim amendment 7021881794.
  • Machine-made translations in ten locales: disclosed in the PR body and put to the maintainer there. Structure is complete (derived judgment 10).
  • Stacking: the PR is a draft on A's branch and says so. This record covers this head only; if A's head moves and B merges it again, the new head needs its own record.
  • Overlap with feat(spec, platform-objects): the standard unit table and the organization unit object sys_unit (ADR-0158 U1-U3) #35581 and fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223 in the additive lists and the Setup-tree pin: textual, whoever lands second re-counts the pin.
  • The PR body's test readings name the previous head; the check-runs on this head are the gate verdicts.

SQL push-down: B adds no query, no id materialisation and no in-app join. Nothing to find.

④ Design judgment

packages/spec/src/system/constants/platform-object-names.ts: holds. Both names are real, sit under the package that registers them, and keep the list sorted. The first consumers (the action-reference check in stack.zod.ts, the lint ladder, the primary-datasource vote) all read them correctly.

plugin.ts and system/index.ts: hold. ADR-0157 left the owning package to this card; the choice (platform-objects, first manifest) is argued in the docblock on the sys_exchange_rate precedent, and the reader is indeed the engine's service, not one optional plugin.

organization-ownership-inventory.ts: holds (derived judgment 9).

setup-nav.contributions.ts: holds. The comment's claims (the exception list is the import door, needs_maintenance is the D8 notice, access by object grant) match the objects.

sys-work-calendar-exception.object.ts: holds against D1 and D10. Checked in the live tree: the import resolver tries the id, the target's title field (name) and its unique fields (code), so the docblock's "by its code or its name" is true; import writes go through beforeInsert hooks even with automations off, because only metadata-bound hooks are skipped; deleteBehavior: 'cascade' is a declared value; the audit writer works from a skip list that names neither object.

sys-work-calendar.object.ts: holds against D1, D2, D3, D8 and D10, with one sentence that does not (S1). Checked: the format rule shape and its evaluator; unique: 'organization'; the needs_maintenance filter (less_than_or_equal is a canonical operator, {60_days_from_now} is in the date-macro grammar and is resolved on the engine's find path; a calendar already past its date is listed too).

S1 (should-fix) — D7's Setup prefill is not delivered, and the timezone help text says something the Setup form refuses. D7 reads "Setup prefills it from the organization's effective time zone", and the card's Scope says "prefilled". At this head the field is required: true with no declared default. The Console create form treats that as required (isRequiredInForm lowers required only for a runtime default) and refuses a blank before any request is sent, so the server-side fill in half A is reachable from an API caller or a seed and never from Setup. The help text, in all eleven locales, tells the administrator "Left out on create, it takes the organization's default time zone". On the form that shows this text, leaving it out is refused. The report's reason for stopping at the server ("no default-token mechanism exists") overlooks the create form's seed context, which already opens a record-currency code field on localization.currency (ADR-0144 D8 rule 4, schemaDefaults.ts), and useLocalization() carries the time zone too. Closed by either of two things: the Setup create form opens with the organization's time zone in the field, which needs a ui/ change and so a claim amendment; or the maintainer rules that the server-side fill alone meets D7. Either way the help text must end up saying what the Setup form does.

S2 (should-fix) — nothing tests the real objects. Half A's hook tests run on fixtures whose fields are plain text: no required, no select, no lookup, no unique key, no format rule. B's tests pin registration, the nav count and bundle ownership. So no test measures a create on the real sys_work_calendar that leaves timezone out (it depends on hooks running before required, which I read but nothing holds), the code-shape refusal, the (calendar, date) key, or the import door on sys_work_calendar_exception naming a calendar by code with one bad row refused alone. The card's Done-when asks for the objects, service and Setup page to land with tests, D3's import is this card's to enforce, and the precedent pinned its own import (packages/rest/src/import-exchange-rate-csv.test.ts). Closed by one test file that drives the two real objects through a real engine with installWorkCalendarHooks bound, covering those four cases.

N1 (nit) — the exception's periods help restates the period format by hand and leaves out the same-day and 24:00 sentences, while the calendar file says the format is stated once in WORK_CALENDAR_PERIODS_HELP. Left as a follow-up; fixing it here moves the head.

N2 (nit) — content/docs/ui/apps.mdx lists what group_configuration holds and describes Exchange Rates; the two new Setup pages are not mentioned anywhere an administrator reads. Skills-docs: none gives a reason for authors, not for administrators. A follow-up, due with the same release (D4).

N3 (nit) — the D8 notice is a second list view an administrator has to open; nothing marks a calendar near its date on the default All view. It meets D8's wording ("marks a calendar ... as needing maintenance"), so it is accepted as built; a row mark on All would be the stronger reading.

Implemented-by: claude/issue-35355-work-calendar-objects-setup
Reviewed-by: isolated-l2-35642

VERDICT: PASS

os-bill pushed a commit that referenced this pull request Nov 19, 2026
… IWorkCalendarService, no-organization refusal

Fix round 1 on the contract review of the first half of #35355 (ADR-0157).

- The arithmetic, the period parser, buildWorkCalendar and the three error
  classes move to @objectstack/formula (an edge objectql already has); spec
  keeps zonedWallClockToUtcMs, the types, the constants and the ledger codes,
  and its module header states Prime Directive #2 as schemas/types/constants
  only. buildWorkCalendar returns a frozen calendar.
- The service contract becomes IWorkCalendarService in
  @objectstack/spec/contracts; the objectql class keeps its name.
- Outside the single tenancy posture (resolveEnginePosture), a computation that
  names no organization is refused ERR_WORK_CALENDAR_UNRESOLVED
  (no_organization) before any read; single is unchanged. The hooks take the
  organization from the session and read nothing without one outside single.
- The 60-day lead's note no longer asserts a publication date.
- The gantt's two ALLOW entries go: the spec no longer exports those names.
- The changeset names the pair, #35641/#35642, and adds @objectstack/formula.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
Base automatically changed from claude/issue-35355-work-calendar-objects-service to main November 20, 2026 02:05
The merge deferred the census and the spec api-surface/export-origins
shards to this commit. The census gains the two working-calendar rows next
to the units-of-measure row from main; the spec shards regenerate to the
bytes main already carries.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:系统设置里新增「工作日历」和「日历例外日期」两个页面;新建日历时,时区一栏默认填好组织的时区,可以改。
  • 为什么做:工作日历的第二半;第一半(计算服务)已经合并,这一半要尽快跟上,两半同批发布。
  • 出错会怎样:日历录错会让按工作日算的期限不对;录入时会拦下明显错误,导入时坏行单独被拒,不影响其它行。
  • 要你做什么:无。
  • 席位意见:通过,没有必改项;席位做合同增量复审后由区域合并,最好紧跟第一半进同一次发布。

席位核对

L1-a delta: ACCEPT, no required item · head a21b8adc1c954b2ed4e2b5b4c0aa43a47480c482 (delta over 320ed52d88, my record 7022988800; seat L2 7023289876 PASS with S1/S2; ruling 7023403692) · base main (PR-A #35641 merged) · K=3 · merge-tree clean · not governed (0 of 55) · 2,229 lines · CI 63 success, 11 skipped, 0 failed · 2026-11-20T03:31Z

Retarget. b154176724 merges main. PR-A's files take main's bytes, #35581's sys_unit rows lead the additive lists, and the Setup-tree pin is re-counted to 34. 06d62d2d7c regenerates the census. My earlier R1, CI green, is closed on this head.

S1 (ruling 6): closed. schemaDefaults.ts adds homeTimeZone, which seeds a field only when it is required: true, text, valueDomain: 'iana_time_zone' and has no declared default. All five form hosts pass useLocalization().timezone beside the currency seed: Object, Modal, Drawer, Tabbed and Wizard. An optional zone field is left blank on purpose, since a blank there means "take the parent's". In first-party metadata the only required zone field is sys_work_calendar.timezone: sys_job, sys_business_unit and sys_organization declare theirs optional. So no existing form changes. The changeset discloses the rule for third-party objects. Pins: organizationZoneSeed-35355.test.tsx checks that only that field is seeded, that an unknown zone seeds nothing, that the author's default wins and that the caller's record wins, plus one cell per host.

S2: closed. packages/rest/src/import-work-calendar-csv.test.ts runs seven cells on the real objects:

  • the zone fill and its no-zone CONTROL;
  • code shape;
  • the (calendar, date) key;
  • an import where a bad line is refused alone;
  • the stored-row org read under group, exactly one read in org_b;
  • isolated: the row is unreachable, with zero hook reads.
    The discriminating pin running under group is the stated deviation. It is the posture where the cross-org row is reachable, so it is the right one.

Other changes.

Surface. Amendment 7023393749 covers ui/packages/plugin-form/**, apps.mdx and the REST tests on the real objects, and 7029465394 covers the objectql line.

Note. #34223 conflicts textually in the Setup-tree pin. Whichever lands second re-counts.

Routing. Seat 5's contract delta at CONTRACT_REVIEW_TIER on this head, then data-1 lands it. PR-A merged at 02:05Z, so landing this half promptly keeps D4's single release.

…er organization

An update that changes a calendar's organization_id while the row stays
the default, set or kept, is refused at the door before any read: 400
VALIDATION_FAILED on is_default (invalid_value). A move without Default
passes. Pinned on the real objects with a system writer, with a CONTROL.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
…s federated disposition

The calendar update hook now asks whether the update payload carries an
organization_id, to judge a move to another organization. The #21918 guard
wants a disposition for every engine reader of an injected column. This one
reads a value off the payload in hand, not storage, and sys_work_calendar is
a platform object that is never federated, so the row is row-value.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 按席位的裁定补了一条规则:被设为「默认」的工作日历不能直接移到另一个组织。
  • 不论这次修改是保持默认还是同时设为默认,都会被拒绝,提示「先取消默认,再移动」;不是默认的日历可以照常移动。
  • 拒绝发生在任何查询之前,不会去读另一个组织的数据。
  • 另补了一条内部检查登记,说明这个判断只看本次提交的内容,不涉及外部数据源。
  • 席位意见:通过,无需再改,分区可以合并。

席位核对

delta ACCEPT (on delta ACCEPT 7029494079) · head 5e806492ca (two commits on a21b8adc1c) · K=8 · merge-tree vs origin/main clean · delta +97/−32, 4 files · CI 63 success, 11 skipped · 2026-11-20T05:01Z

  • d0339ffb6c (seat ruling, amendment 7029482863): beforeUpdate sets moved when the payload carries an organization_id whose organizationOf differs from the stored row's, and then builds { read: false, moved: true }, so no one-default read runs for a move. judgeCalendar computes defaultAfter from the payload when it carries is_default, else from the stored row, so both "stays default" and "sets default" are refused; the elsewhere create branch is unchanged behind else. A move to a null organization also counts as a move. Refusal: VALIDATION_FAILED, is_default / invalid_value, fixed text. Pins: stays-default refused with reads == [], sets-default refused with reads == [], CONTROL lands with organization_id: 'org_a', is_default: false; ablation 2 red per the report. The test helpers move to module scope with no change in what they record. Changeset and module note each name the rule.
  • 5e806492ca: one READERS row in federated-injected-column-readers.test.ts, row-value: the hook inspects the payload in hand and reads no storage, and sys_work_calendar is a platform object. Correct disposition for the finding(objectql): the cascade scan still probes a federated object on its other injected anchors — deleting a business unit answers 400 INVALID_FILTER on showcase_ext_customer.owning_business_unit_id (the family closing card after #7738 and #21910) #21918 guard.

No required item. Land on this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

VERDICT: PASS

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5e806492ca75c375b4c0c93a2557d983757d636e
Local-runs: probe — node scripts/pm/check-governed-merges.mjs --pr 35642, read-only, as the delta request asked; no build, test, gate or ablation run
Scope: hits + implementing files

Delta on record 7023289876 (head 320ed52d88). No must-fix, no should-fix.

Range. The PR's own changes since 320ed52d88: b154176724..5e806492ca, nine commits, 26 files, +520 −47. b154176724 is the one merge of main (second parent ed906d567a, which is also the merge base with current main); what it brought in is excluded. Its resolution is mechanical: the Setup-tree pin moves 33 to 34 for the sys_unit row main added, and the tenancy census is regenerated in 06d62d2d7c. Whole PR against the merge base: 56 files, +2270 −30.

Check-runs on this head as read: 63 success, 11 skipped, none failed, none in progress. The PR is still a draft.

① Derived judgments

  1. S1: closed. schemaDefaultValues takes homeTimeZone in its seed context and seeds a field that is required, text, valueDomain: 'iana_time_zone', with no declared default; it sits directly after the currency branch and follows it (author default wins, caller record wins, unknown zone seeds nothing). All seven create-seed call sites in the five form containers pass useLocalization().timezone. That value is the organization's effective zone (the deployment cascade, floor UTC), the same setting the server fill reads, so the form and a write that omits the field agree. The other in-tree iana_time_zone fields (sys_job, sys_business_unit, sys_organization) are optional and stay blank; a test pins that. The timezone help now says both halves, and all eleven bundles carry the sentence.
  2. S2: closed. packages/rest/src/import-work-calendar-csv.test.ts drives the real SysWorkCalendar and SysWorkCalendarException on sqlite with the hooks bound, through the REST create and import doors. The four cells are there and each asserts the envelope, not only a status: create without timezone stores the organization zone (CONTROL: an organization with no zone gets 400, timezone required); a code outside the shape gets 400 code invalid_format; a second (calendar, date) row gets 409 UNIQUE_VIOLATION while the same date on another calendar lands; an import naming the calendar by code reports total 3, created 2, one error on row 2 (periods invalid_value).
  3. Group-posture update pin: it discriminates. Session in org_a, stored row in org_b, edit { is_default: true, organization_id: 'org_a' }; org_b holds a default and org_a holds none; the test records every one-default read by the organization it ran in and asserts exactly ['org_b'] plus the is_default invalid_value refusal. A hook reading in the session's organization would record ['org_a'] and admit the edit; a hook that never read would record nothing. Both go red. One caveat on how the third condition is met: for a caller that is not a system writer the engine does not hand the payload's organization_id to the hook (if it did, the move rule would refuse with zero reads and this assertion would fail), so this pin proves stored-row organization against session organization. The payload-organization case is proved by the system-writer move cells in item 4. Together the three forms are covered. The isolated leg (RECORD_NOT_FOUND, zero reads) is right.
  4. Move rule (d0339ffb6c): correct, and it covers a system writer. In beforeUpdate, a write whose organization_id differs from the stored row's gets a scope with no read; judgeCalendar then refuses when the row is the default after the write, whether the write sets Default or the stored row keeps it. The check sits ahead of the posture branch, so it does not depend on posture or on the writer having an organization. Booleans are normalised at the update door before hooks, and the stored row is bound for by-id writes and per matched row for predicate writes, so both paths reach it. The refusal is the existing envelope (VALIDATION_FAILED, one fields[] entry, is_default, invalid_value) and its reason is one constant sentence with no interpolation, naming no organization and no code. The pins run with a system context under isolated: stays-default refused with zero reads, sets-default refused with zero reads, and the CONTROL (a move without Default) lands in the new organization.
  5. READERS row (finding(objectql): the cascade scan still probes a federated object on its other injected anchors — deleting a business unit answers 400 INVALID_FILTER on showcase_ext_customer.owning_business_unit_id (the family closing card after #7738 and #21910) #21918 guard): correct. Key work-calendar-service.ts#installWorkCalendarHooks :: organization_id, disposition row-value. The guard scans string-literal uses of an injected column; the only new one is hasOwn(data, 'organization_id'), which asks whether the payload in hand carries the key and reads no storage. row-value is the disposition the ledger defines for that. The row's second clause (a platform object is never federated) is true and not needed for the disposition.
  6. (c): done. The other-organization default refusal no longer assumes the writer works in an organization; one literal changed, same field and code.
  7. N1: closed. The exception's periods help is its lead sentence plus WORK_CALENDAR_PERIODS_HELP; all eleven bundles carry the full format statement.
  8. N2: closed. content/docs/ui/apps.mdx lists working calendars under group_configuration and describes both pages.
  9. N3: accepted as built.

② Semver level

Unchanged at the top: @objectstack/platform-objects minor, Clause-②: yes (widening), Metadata-protocol: added. The round adds @objectstack/objectql patch and @object-ui/plugin-form patch. Patch is right for both: the move rule refuses a write that left an organization's default in an undefined state and has no released predecessor (half A has not shipped), and the form seed fills a field that was blank and required.

③ Boundary flags

④ Design judgment

The move rule is the right size. It refuses the one case that would leave two organizations' defaults unjudged, does it before any read, and leaves an ordinary move alone. Reusing the existing envelope keeps the door's vocabulary at one shape.

N4 (nit) — the move refusal's cells assert the code, field and reason code but not the sentence, and they call the engine, so the 400 status for this refusal is asserted only by its neighbours in the same envelope. Both hold by reading. One assertion on the message text would pin "names no organization or code".

N5 (nit) — claim surface: amendment 7029482863 names work-calendar-service.ts and its test. The READERS row is in packages/objectql/src/federated-injected-column-readers.test.ts, which no amendment names. One line on the card closes it.

N6 (nit, follow-up card) — the CONTROL now pins a move without Default as allowed. A move carries the calendar row only; whether a calendar's exception rows follow it is not decided in ADR-0157 and not pinned in this pair. Not introduced by this round. Detail went to the seat.

Implemented-by: claude/issue-35355-work-calendar-objects-setup
Reviewed-by: isolated-l2-35642

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Landing · area data-1 · 2026-11-20T05:12Z

reading value
Head 5e806492ca (main merged at b154176724; K=8 at the last read, merge-tree clean). CI green: 63 success, 11 skipped
Reviews L1-a 7022988800, delta 7029494079, delta 7030929617 ACCEPT. Seat contract L2 7023289876 PASS (S1/S2) → ruling 7023403692 → delta 7031077678 PASS, no must-fix or should-fix. N5 closed by amendment; N4 and N6 noted
Scope Not governed (0 of 56 paths); 2300 lines; claim 7013077388 with amendments 7021881794, 7022993369, 7023393749, 7029465394, 7029482863 and the N5 line
Pair Not released alone; pair #35641/#35642 (ADR-0157 D4). #35641 merged 2026-11-20 02:05Z

State: ready → auto-merge (merge queue). Fixes #35355.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 20, 2026 05:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Landing seat pull-back · area data-1 · 2026-11-20T05:14Z

The landing seat takes this PR out of the merge queue: the seat's contract delta 7031077678 came with one more ruling to apply before landing (a calendar and its exception dates stay in the organization they were created in). The PR is re-landed after a short L1 delta and a narrow seat delta on the new commit.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Relay pr_dequeue · session_01Utp6Ca1jJvsA1dHsPwMiQb · request fw-20261120T051528Z-383863

Merge-queue dequeue of #35642 — cause seat-asks.

  • Relay read: landing seat repo:objectstack#5 · os-bill, signed by repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb.
  • Seat's reason: Landing seat pulls back to apply one more seat ruling from the contract delta before landing; it re-lands after the short deltas.

The relay sends dequeuePullRequest after this comment and confirms the removal by reading the queue back; the run row of this request carries the outcome. Re-queue once the cause is fixed (landing-operations.md, the landing seat's queue duty).

@objectstack-fleet
objectstack-fleet Bot removed this pull request from the merge queue due to a manual request Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44679664664 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (3/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/approval-read-over-mcp.dogfood.test.ts > an approver's agent lists the approvals waiting on them over MCP (#32442, read half) > ⭐ the query tool's tex
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: expected 'Query records from an object with opt…' to contain 'sys_approval_request'
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 17 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

…ization

An update that changes the organization_id of a sys_work_calendar or a
sys_work_calendar_exception row is refused at the door, before any read,
for every writer, system writes included: 400 VALIDATION_FAILED on
organization_id (invalid_value) with a fixed reason. To have a calendar in
another organization, create it there. An edit that leaves organization_id
out or repeats the stored one is judged as before. A predicate update is
judged per matched row, since the engine hands the hook each row's stored
image. This replaces the narrower move-with-Default rule, which is removed.
The #21918 READERS row follows the read into its new helper.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
…tion

On a create, and on an update that carries calendar, the
sys_work_calendar_exception hooks read the calendar by id in the
exception's organization (the session's on a create, the stored row's on
an update), one indexed read for every writer, system writes included.
When none comes back the write is refused: 400 VALIDATION_FAILED on
calendar (invalid_value) with one fixed reason that names no organization,
code or id, so a calendar of another organization and an id that names no
calendar get the same body. A create the hooks cannot read for is refused
the same way. The import door is judged row by row through the same hook.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 按席位的两条裁定收紧了规则:工作日历和它的例外日期一旦建好,就不能再改到另一个组织;任何人、包括系统写入都一样,要在别的组织用就在那边新建。
  • 上一版「默认日历不能移动」的规则被这条更严格的规则取代。
  • 例外日期只能指向本组织的日历;指向别的组织的日历或不存在的日历,都给出同一句提示,不透露其他组织的任何信息。
  • 文件导入一年假期的流程不受影响。
  • 席位意见:通过;主干已前进较多,合并前先合入主干、自动检查全绿后再合并。

席位核对

delta ACCEPT (on delta ACCEPT 7030929617) · head 0ceb0b5c58 (two commits on 5e806492ca) · K=28 · merge-tree vs origin/main clean · delta +204/−56, 5 files · CI 63 success, 11 skipped · 2026-11-20T07:28Z

  • 262cd110b0 (seat N6): refuseOrganizationChange runs first in both beforeUpdate hooks, before any read and before the system check matters: a payload organization_id whose organizationOf differs from the stored row's is refused on organization_id with a fixed reason; omitted or repeated passes. Per-row under a predicate update (the engine hands each matched row with its pre-image). It replaces d0339ffb6c's move-with-Default branch, which is fully removed (moved gone from ReadScope); the update's read scope is the stored row's organization (updateReadOrganization), as before the move rule. READERS row rekeyed to refuseOrganizationChange, still row-value, now naming both platform objects. Changeset line replaced, not appended.
  • 0ceb0b5c58 (seat ruling A): refuseForeignCalendar on exception create and on any update carrying calendar: one find by id, fields: ['id'], under readContext of the exception's organization (session org on create via insertReadOrganization, stored org on update). No row → refused on calendar with a fixed sentence echoing no value; foreign and non-existent ids are identical, so nothing about another organization leaks. A non-scalar ref, or a create the hook cannot read for (elsewhere, or no organization outside single), takes the same refusal: fail closed. Blank is left to required. No first-party seed writes sys_work_calendar_exception, so no seed path meets the create rule.
  • Pins as reported: 4 calendar moves, an exception move and a predicate update on each object refused with status and sentence asserted; CONTROL with the org omitted or repeated; foreign calendar on create, on create naming the other org and on re-point refused; envelope JSON-identical for a non-existent id and REST bodies byte-identical; same-org CONTROL on create and update. Ablations C1/C2 2 red each.

Required before landing:

  • R1 (merge main). K=28 ≥ 15: merge origin/main, re-run, land on all green. No fresh L1 unless the merge needs a conflict resolution in these files.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

VERDICT: PASS

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5a02bbf6ec34ca501e06c4099a97b9b6d0eee962
Local-runs: probe — node scripts/pm/check-governed-merges.mjs --pr 35642, read-only, as the delta request asked; no build, test, gate or ablation run
Scope: hits + implementing files

Second delta, on record 7031077678 (head 5e806492ca). No must-fix, no should-fix.

Range. The PR's own change: 5e806492ca..0ceb0b5c58, two commits (262cd110b0, 0ceb0b5c58), 5 files, +204 −56. The head is 5a02bbf6ec, a merge of main (92ab0564ed) onto 0ceb0b5c58; it was read only for the one file both sides touch.

Check-runs as read. On 0ceb0b5c58: 63 success, 11 skipped, none failed. On the head 5a02bbf6ec: 17 success, 9 skipped, 40 in progress, none failed; Test Core (4/10), the shard that runs the #21918 guard, is among those still running.

① Derived judgments

  1. Organization rule (262cd110b0). refuseOrganizationChange is the first statement of both beforeUpdate hooks after the guards. It compares the payload's organization_id with the stored row's and makes no read, so nothing the hook reads comes before it; the only earlier read is the engine's own read of the stored row, in the write's own scope. A payload that leaves the key out or repeats the stored value returns at once. Clearing the organization, or setting one on a row that has none, counts as a change and is refused. The refusal is the existing envelope (400 VALIDATION_FAILED, one fields[] entry, organization_id, invalid_value, no value) with one constant sentence per object. The move-with-Default branch and its moved scope are gone; no stale branch is left.
  2. Writers. A system writer's payload reaches the hook as sent, so it is refused; that is the pinned case. For a caller that is not a system writer the engine hides organization_id from hooks and keeps the row's own, unless the tenant wall judges the column, in which case an admitted re-point is shown to the hook and now refused. In all three the stored organization does not change. See N9 for the wording.
  3. Predicate updates. The engine resolves the matched rows before the before phase and dispatches beforeUpdate once per row with that row's stored image, all ahead of the write, so one refusing row refuses the write. Pinned on both objects.
  4. Other platform writers. The organization-ownership ceremony attributes rows below the hooks (direct statements), and the two seed-ownership claims write owner_id only and skip sys_ objects. Nothing in the tree re-homes a calendar through the update door, so the rule refuses no existing platform write.
  5. Exception's calendar (0ceb0b5c58). On a create, and on an update that carries calendar, the hook makes one find by id with limit: 1 in the exception's organization: the session's on a create, the stored row's on an update. On an update it runs after the organization rule and the D10 judgment, both of which read nothing. The read context is the service's existing one, system authority with tenantId set to that organization. System authority lifts permissions and row rules, not the organization scope: with tenantId present and no membership set, the driver narrows to that one organization under isolated and group alike. Under single there is no narrowing, which is that posture's meaning and matches the service.
  6. One refusal, no existence oracle. A calendar of another organization and an id that names no calendar take the same path: one scoped find that returns nothing, then the same refuse call with a constant sentence and no value. Nothing in the body or the path depends on which case it was. The test compares the two resolved envelopes as serialized strings, from the engine and from the REST create door for a member, and asserts the body carries neither id, either organization, nor the calendar's code.
  7. Fail closed. When the hook may not read (the row names an organization other than the session's, or there is no organization outside single) or the reference is not a scalar, control falls through to the same refusal. It does refuse; it does not skip. A blank calendar is left to required.
  8. CONTROLs. An edit that omits or repeats organization_id lands on both objects; an exception naming a calendar of its own organization lands on create and on re-point. The earlier group-posture pin and the four REST cells are unchanged and still hold. The seed loader writes each load under its organization's tenant, so an ordinary seed or import is readable; see N7 for the one path that is not.
  9. READERS row. Rekeyed to work-calendar-service.ts#refuseOrganizationChange :: organization_id, still row-value. Both literal uses of the column are in that function (the payload check and the refusal's field name), and neither reads storage. Correct.
  10. Merge 5a02bbf6ec. The four PR files are byte-identical to 0ceb0b5c58. The shared ledger file is main's plus the one calendar row: no duplicate key, the guard's scanner is unchanged, and the function the row names exists in the merged source. No non-textual problem by reading; the guard's own run on this head had not finished when read.
  11. Record 7031077678's nits: N4 closed (the cells assert 400, the code and the sentence); N5 closed (claim amendment 7031089971); N6 closed by the two rulings.

② Semver level

Unchanged. @objectstack/objectql stays patch: both rules refuse writes on two objects no release has shipped.

③ Boundary flags

④ Design judgment

Both rules are the simpler ones. "Never changes organization" needs no read and removes the case record 7031077678 left open; "names a calendar of its own organization" keeps an exception and its calendar in one organization from the first write. One sentence for every way the second can fail is the right call at a door that may be asked about ids it should not confirm.

N7 (nit, follow-up) — a seed load that carries no organization (several organizations, none pinned) is told by the seed loader to name the owner on each record. Such an exception row is a create the hook cannot read for, so it is refused, with the sentence about the calendar's organization. That follows the ruling. The cause there depends only on the write itself, so a reason of its own for the unreadable case would give nothing away and would tell a seed author what to do. Loads pinned to an organization, and installs with one organization, are unaffected.

N8 (nit) — legs that hold by reading and have no cell: the calendar rule under group; a create with no organization outside single; the import door with a calendar of another organization; and an exception update that carries both a new organization and calendar, which would show zero reads directly (the read recorder counts one-default reads only).

N9 (nit, wording) — "refused ... for every writer" is exact for a system writer and behind the tenant wall. Without the wall the engine drops the key and the rest of the edit lands, as the unchanged group pin shows. The outcome is the same; the sentence could say "no writer can change it". The PR body's pairing paragraph names the first merge of main only, not 5a02bbf6ec.

Implemented-by: claude/issue-35355-work-calendar-objects-setup
Reviewed-by: isolated-l2-35642

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Landing · area data-1 · 2026-11-20T08:00Z

reading value
Head 5a02bbf6ec (merge of main 92ab0564ed onto 0ceb0b5c58; the four PR files byte-identical to 0ceb0b5c58). CI green on this head
Reviews L1-a 7022988800, deltas 7029494079, 7030929617, 7033306738 ACCEPT. Seat contract L2 7023289876 PASS → ruling 7023403692 → delta 7031077678 PASS → seat rulings (organization never changes; exception names a calendar of its own organization) → delta 7033477356 PASS, no must-fix or should-fix. N4/N5/N6 closed; N9 fixed in the body; N7/N8 go to follow-up cards under #35355
Earlier landing Pulled back before the seat rulings (7031135306); this is the landing on the final head
Scope Not governed (0 of 57 paths); 2458 lines; claim 7013077388 with amendments 7021881794, 7022993369, 7023393749, 7029465394, 7029482863, 7031089971
Pair Not released alone; pair #35641/#35642 (ADR-0157 D4). #35641 merged 2026-11-20 02:05Z

State: ready → auto-merge (merge queue). Fixes #35355.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Working calendars ②: sys_work_calendar objects, calendar service and Setup page

2 participants