Repository navigation
fix(approvals): the opening refusal says the object closes on its approval field only where a gap is about that field - #38546
Conversation
…e a gap is about that field The host's gap and an unreadable flow are raised on an object that declares closedStates on any field; where they are the only gaps, the opening refusal's lead now says the approval can act on an object that declares closedStates, in all 11 locale packs of the plugin's catalog. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…s and holes Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
📓 Docs Drift Check7 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 26f1ee75276edbd75bea96133e4f95a5edf1ba18 && git checkout 26f1ee75276edbd75bea96133e4f95a5edf1ba18
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4cc09b16f4eae866c94e99a12bde24470bf1eab4 2668361c1b12b3c7504dd8ee2311ef1c2c6fa78c && git checkout -B drift-repro 4cc09b16f4eae866c94e99a12bde24470bf1eab4 && git merge --no-ff 2668361c1b12b3c7504dd8ee2311ef1c2c6fa78c
node scripts/docs-audit/affected-docs.mjs --json 4cc09b16f4eae866c94e99a12bde24470bf1eab4 |
… on its approval field only where a gap is about that field The service's warn line at every opening refusal now chooses its wording by the same predicate as the refusal's lead, exported from approval-opening-refusal.ts, so a refusal whose only gaps are the host's or an unreadable flow no longer logs that the object closes on its approval field. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5phEgfPTCgvPqh4ER2 Contract reviewServed-tier: Face: ① Derived judgments
② Semver levelpatch for ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5phEgfPTCgvPqh4ER2 Final green head · 2026-11-29T09:31Z —
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB 席位核对 — ACCEPT · L1-b · area o5-data · Head-sha
|
d313098
into
claude/o5-data-approvals-trunk
Requested by Leehom · project thread
Part of #37766 — the review follow-up of the opening check (slice B) named in claim amendment 7252959941; the card stays open for slice D and the held N45 work.
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The refusal at an approval's first request (
openingRefusalText) always led withapprovalOpeningRefusedLead, "the object closes on its approval field". Two of the gaps the opening check raises are not about that field:no_job_serviceis raised for any object a step can act on that declaresclosedStateson any field (approval-opening-check.ts, section 6, the host);unreadable_flowis raised before anything about the field is known (the early return for a missing root flow, and every callee that cannot be read).Every other gap kind is pushed only inside the loop over objects that close on the step's own approval field (section 5,
concernedObjects), so the field lead is true for them. Where every gap isno_job_serviceorunreadable_flow, the lead is now the new catalog sentenceapprovalOpeningRefusedClosedStatesLead: "The approval of OBJECT RECORD was not started: it can act on an object that declares closedStates." Any field gap, alone or beside those two, keeps the field lead. The per-gap sentences are unchanged.src/approval-opening-refusal.ts— the lead choice:NOT_ABOUT_THE_FIELD, read through the exported predicategapsAreAboutTheField.src/approval-service.ts— the warn line logged at every opening refusal picks its wording with the same predicate (the fold below).src/translations/messages.ts— the new id in all 11 packs (en, zh-CN, ja-JP, es-ES, zh-Hant, ar, fr, pt-BR, ru, de, ko).src/approval-opening-refusal.test.ts— new, 6 tests.src/approval-opening-check-37766.integration.test.ts— one nesteddescribewith 2 tests on the log line (host-only refusal, plus a field-gap control).boot()gains an optionalwarnssink for the service logger..changeset/37766-opening-lead.md—@objectstack/plugin-approvalspatch.Authorship. The patch was written, built and reverse-verified by the slice B card thread on the trunk, which could not push it; this PR carries it after a hunk-by-hunk read. Corrections made on top of it:
approvalMessages, so what they hold is which lead is chosen and in which pack, not the prose. One test added: the two leads differ in every pack. The field-gap test gains the order[host, pause].37766-opening-lead.md.Fold: the same false claim in the refusal's log line (area decision)
The first round listed this as out of scope.
approval-service.tslogged "the record's object closes on its approval field and the approval cannot show it in progress" atwarnfor every opening refusal, including host-only and unreadable-only ones. The area folded it into this PR. The warn now readsgapsAreAboutTheField(judgement.gaps), the one predicate the lead already uses (exported, no second copy). Where it is false, the log says "it can act on an object that declares closedStates, and this host runs no job service or a flow it runs could not be read". The loggedgapskinds are unchanged.The four adjacency conditions, each with evidence:
no_job_serviceorunreadable_flow), at the same call site: theif (judgement.gaps.length > 0)block that throwsopeningRefusalText.approval-service.tsis on slice C's file surface (claim 7250894927), and that claim belongs to this area. The area decision names it as its own.approval-service.tsis now in the set:check:error-code-provenance,check:adr-symbol-anchors,check:cli-command-ids,check:dispatcher-error-vocabulary,check:error-status-conformance,check:object-def-param-keys,check:optional-error-sink,check:settings-bind-window. All of them were run here and exit 0. The new tests go into the existing integration harness, not a new file.The three checks the PM asked for
reviewFaceon this diff (6 paths after the fold, re-read) —reviewFace(paths, objectstack, { declaredOn: [the changeset] })answers facedeclaration, tierTIER_DEFAULT,hits.schema: [],hits.rules: []. No face beyond theClause-②: yesdeclaration is hit: nopackages/specpath, no governed path.filesisdist,README.md,CHANGELOG.md. After the build,approvalOpeningRefusedClosedStatesLeadis indist/index.jsanddist/index.mjs; the positive controlapprovalOpeningRefusedLeadis in the same two files. It reaches a caller two ways: as the refusal text through the request door (VALIDATION_FAILED: …, thrown atapproval-service.tsaround line 5259), and asmessages.approvalOpeningRefusedClosedStatesLeadin the i18n service, becauseApprovalsTranslationsloadsapprovalMessagesas each locale'smessagesface onkernel:ready(approvals-plugin.ts). SoClause-②: yes (widening)is right, and so isMetadata-protocol: none: it adds nothing a metadata author can write.Tests
The tests import
./approval-opening-refusal.jsrelatively, fromsrc, so neither leg needs a rebuild to reachdist.Ablations: every lead forced to the field lead (head cf61012); every log line forced to the field claim (head 2668361)
node scripts/ablation-replace.mjsonapproval-opening-refusal.ts, anchoraboutTheField ? pack.approvalOpeningRefusedLead : pack.approvalOpeningRefusedClosedStatesLeadreplaced bypack.approvalOpeningRefusedLead /* ABLATED: always the field lead */:Log ablation (head 2668361). In
approval-service.ts, the anchorthis.logger?.warn?.(gapsAreAboutTheField(judgement.gaps)was replaced bythis.logger?.warn?.(true /* ABLATED: always the field claim */:A first attempt at the lead ablation used the bare replacement
pack.approvalOpeningRefusedLead, which is a substring of the anchor. The tool refused it ("the replacement count moved 1 -> 1"), restored the file and ran nothing. That attempt is void, not a reading.Package suite and typecheck (head 2668361)
pnpm --filter @objectstack/plugin-approvals test:Test Files 137 passed (137)·Tests 2114 passed (2114)· lockVERDICT command-exit 0(at cf61012: 2112/2112).pnpm --filter @objectstack/plugin-approvals typecheck:VERDICT command-exit 0;check:test-typecheck: OK … 8 file(s) / 321 error(s) / 27 pinned signature(s) held in test-typecheck-debt.json.tsc -p tsconfig.test.json --listFileslistsapproval-opening-refusal.test.ts(1 hit), so the test layer compiles the new file.approval-notification-keyed-text.integration.test.ts("every shipped locale carries every sentence, with the same holes") passes in that run and covers the new id in all 11 packs.Acceptance notes
overlap-check.mjs --base=origin/claude/o5-data-approvals-trunk→VERDICT overlap exit 1: merges cleanly into the trunk (still 4cc09b1), feat(approvals): on a closing field, an approval's decision is written when the approval is over (ADR-0162 item 8, slice 3) #38540 and feat(objectql): a record in a closed state, and its lines, are closed to change (closedStates, ADR-0162) — trunk #38497. It conflicts with feat(approvals): the opening check's conditions are reported where a flow or an object is published (ADR-0162 item 7, slice N45) #38527 (slice N45, held for the maintainer) in two files, both textually:approval-opening-refusal.ts: N45 moves the per-gap loop intogapSentencesand addspublishRefusalText; this PR changes theleadline ofopeningRefusalText. Keep both, with the lead choice above[lead, ...gapSentences(gaps, pack)].approval-service.ts: N45 adds an import line next to theapproval-opening-refusal.jsimport that this PR widens. Keep both lines.Under the claim, whichever lands second resolves it. N45's own
publishRefusalTextnames the published item in its lead and is not affected by this defect.Lint & Repo GatesandTypeScript Type Checkfailed only because their lanes concludedcancelled, not on a finding. Run 46244574938 was cancelled when head 2668361 was pushed at 08:54:45Z: its lanes stopped between 08:54:49Z and 08:55:03Z, and the two aggregators refuse anycancelledlane (lint lane … concluded cancelled -- expected success, six lint lanes and four type-check lanes). The two lanes that had already finished,lint-scoped-toolingandlint-pm-dispatch-gates, concludedsuccess. No code change answers it. On head 2668361 both checks concludedsuccess(check-runs read once: 37 success, 14 skipped, 1 still running, 0 failure).test:repo(the vitestrepoproject) was not run locally: this diff neither edits that project's tests nor is named by the derivation. CI'sTest Corecarries it.Verification
Read first (by risk):
packages/plugins/plugin-approvals/src/approval-opening-refusal.ts,gapsAreAboutTheField, and its second caller inapproval-service.ts(the warn line): does any gap kind other than the two inNOT_ABOUT_THE_FIELDget raised outsideconcernedObjectsinapproval-opening-check.ts? (Read on this head: no. Sections 5 and 6, and the early return.)packages/plugins/plugin-approvals/src/translations/messages.ts: the 11 new lines, especially the four modal corrections.packages/plugins/plugin-approvals/src/approval-opening-refusal.test.tsand the new nesteddescribeat the end ofapproval-opening-check-37766.integration.test.ts.Two-minute check:
pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/approval-opening-refusal.test.ts src/approval-opening-check-37766.integration.test.tsshould reportTests 15 passed (15).Local gates (head 2668361)
The derivation was
dispatch-gates.mjs --commands --repo objectstack-ai/objectstackwith the 6 changed paths passed explicitly (72 families; 64 at cf61012). Each one was re-run on 2668361 with its exit code captured before any pipe, pluscheck:i18n-coverageandcheck:i18n-walk-parity.--rangives:72 derived, 70 run, 2 NOT-MEASURED, 0 UNRUN(both derived from a recorded exit 3).pnpm check:i18n(2668361: EXIT=0 after the same closure build,in sync (21 bundle(s))): at cf61012 the first run exited 3 (PREREQUISITE NOT MET — the workspace CLI is not built). After its one-command closure build under the verify lock (VERDICT command-exit 0, 70 tasks), the re-run gave EXIT=0:plugins/plugin-approvals in sync (21 bundle(s))·check-i18n-bundles: OK (10 package(s) — all bundles in sync, no undeclared authoring keys).pnpm check:i18n-coverage: EXIT=0,OK (15 config(s), 577 baselined untranslated string(s), none new).pnpm check:i18n-walk-parity: EXIT=0,19 declared group(s), 17 walked, 2 exempted.pnpm check:keyed-text-bounds,pnpm check:i18n-stale-fill,pnpm check:doc-authoring,pnpm check:issue-citations,check-changeset-no-major.mjs --base origin/main,check-adr-0087-registration.mjs --base origin/main,check-empty-changeset.mjs,pnpm check:nul-bytes, and the other derived families: exit 0.check-plugin-teardown-shape.mjs --self-test. Exit 3: its positive control is pinned to a commit that this shallow clone cannot reach. CI runs it.pnpm check:dual-build-cjs-loads. Exit 3: it reads every package'sdist, and only the approvals closure was built here.Build Corein CI runs it.Generated by Claude Code