Skip to content

refactor(plugin-approvals): move the approval service's timing constants and run-liveness tables to their own modules - #39727

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-8k8lfk
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-8k8lfk

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Part of #38665 (PR 0a-2 of the series ordered by ruling 7310432861 and the step-1 map 7310940257: the second slice of the prelude ahead of the class. No class member moves. The rest of the prelude and the class modules follow in later PRs; the next slice is recorded on the card as a Resume-from hand-over.)

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:审批的提醒间隔、超时升级、搁浅请求判定等行为都不变,只是把审批服务大文件里约 530 行常量和类型搬进同目录子文件夹里的两个新文件。
  • 为什么做:拆分审批服务大文件专题的第二步,接在已合并的第一步后面,让这个大文件逐步按职责拆开,减少审批相关的卡互相排队。
  • 出错会怎样:最坏是编译不过,CI 会直接拦下;运行行为不受影响,撤回本 PR 即还原。
  • 要你做的:无。

What changes

Move-only, two leaf modules under src/approval-service/, neither importing from approval-service.ts:

Moved declaration New file
REMIND_COOLDOWN_MS, ESCALATION_JOB_NAME, ESCALATION_SCAN_INTERVAL_MS, SLA_ACTOR_ID, ESCALATION_ENABLED_FLIP_CUTOFF_MS approval-service/sla-constants.ts
RunLiveness, RUN_STATUS_LIVENESS, TERMINAL_RUN_STATUSES, RequestStrandability, REQUEST_STATUS_STRANDABILITY, STRANDABLE_REQUEST_STATUSES, STRANDED_CONTINUATION_KEY, CONTINUATIONS_A_STATUS_CAN_ISSUE, classifyStrandedRunState, refineFailedRunState, StrandedRunState, StrandedContinuationSignal, ApprovalContinuationResult, StrandedApprovalRequest approval-service/run-liveness.ts

approval-service.ts imports what it still uses and re-exports the 11 names it exported before (export { … } for the 7 values, export type { … } for the 4 types), so every importer is unchanged. The [#16433] comment on the ExecutionStatus import moved with the import to run-liveness.ts, the only place that now reads it.

Net growth past a pure move (1,115 changed lines: +586 / −529):

  • run-liveness.ts +16 over its moved lines: a 7-line header comment, the 5 import lines (with the moved 2-line [#16433] comment) and export on the file-local declarations approval-service.ts imports.
  • sla-constants.ts +7: the header comment.
  • approval-service.ts +31: the two import blocks and the two re-export blocks, minus the ExecutionStatus specifier and the ConsumedSuspensionVerdict import it no longer needs.
  • .changeset/38665-approval-service-run-liveness-module.md +10, patch on @objectstack/plugin-approvals.

approval-service.ts: 15,045 → 14,547 lines against current main (09a1d7b).

Tests

Acceptance notes

  • Published output, built from base 3896b70 and from cb5ff9a: dist/index.d.ts sorted line by line differs by one blank line; dist/index.js / index.mjs differ only in the bundler's per-file source comments and in the position of one unchanged function (approvalNotice), as the bundler now emits the two new modules first. No statement added, removed or changed.
  • Anchors: docs/qa/platform-checklist/areas/approvals.json cites approval-service.ts#ESCALATION_SCAN_INTERVAL_MS; the name is still exported from that file (re-export), and node scripts/check-platform-checklist.mjs --changed-from origin/main reads 20 anchors judged, 0 lost. The prose anchor is left as it is; the docs file is outside this claim's surface.
  • Merged main once after fix(approvals): name the queue or position each pending approver was expanded from #39662 (same file, earlier claim) landed; clean merge, the delta against main is exactly the four files above.

Verification

Local gates at e72994f (dispatch-gates --commands, 69 derived)

node scripts/pm/dispatch-gates.mjs --ran FILE --repo objectstack-ai/objectstack: 69 derived, 69 run, 0 NOT-MEASURED, all exit 0 recorded per line. npx eslint --no-inline-config over approval-service.ts and approval-service/*.ts: exit 0. Dependency closure build, typecheck and package build: exit 0 under os-verify-lock.

Two-minute check: git diff --color-moved=dimmed-zebra origin/main...HEAD -- packages/plugins/plugin-approvals/src shows the declarations as moved blocks; what is not dimmed is the imports, the re-exports and the two header comments.


Generated by Claude Code

…nts and run-liveness tables to leaf modules

Move-only: the reminder/SLA constants go to approval-service/sla-constants.ts
and the run-liveness, strandability and stranded-continuation declarations
to approval-service/run-liveness.ts; approval-service.ts imports them and
re-exports every name it exported before.

Claude-Session: https://claude.ai/code/session_01L9qibwUJvVPPjkmMrE42t7
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-approvals, touching 39 documentable anchor(s).

27 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 6b551a061a8abe63d37fe3ce378ff17b7132709a.

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

What this run could not see
  • 2 anchor(s) matched too much of the corpus to be a work list: objectName (symbol, 62 pages), recordId (symbol, 39 pages)
  • 16 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 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 — 6 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 6b551a061a8abe63d37fe3ce378ff17b7132709a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 2a63f2d5e782f7da129e061ae18cf88f0fee692c — the merge of head e72994f975e2b29a955f8c2c5490283de833dedb into base 6b551a061a8abe63d37fe3ce378ff17b7132709a, 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 2a63f2d5e782f7da129e061ae18cf88f0fee692c && git checkout 2a63f2d5e782f7da129e061ae18cf88f0fee692c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6b551a061a8abe63d37fe3ce378ff17b7132709a e72994f975e2b29a955f8c2c5490283de833dedb && git checkout -B drift-repro 6b551a061a8abe63d37fe3ce378ff17b7132709a && git merge --no-ff e72994f975e2b29a955f8c2c5490283de833dedb

node scripts/docs-audit/affected-docs.mjs --json 6b551a061a8abe63d37fe3ce378ff17b7132709a

⚠️ 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 6b551a061a8abe63d37fe3ce378ff17b7132709a → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibz12BVzo6a9hKybbEd

席位核对

L1-b · 2026-12-04T15:26Z · ACCEPT · head e72994f975 · report 7415167710 (on #38665) · ruling 7310432861 · step-1 map 7310940257 · file surface 7407330587

  • Face (l1-face.mjs --pr 39727): one flag, read and not a red. Draft, base main, @objectstack/plugin-approvals patch, Clause-②: no · Metadata-protocol: none. 39 success, 17 expected skip, 0 failed, 0 pending. mergeable_state is clean. Not governed, 1,115 lines.
  • Relation: Part of #38665 is right. This is PR 0a-2, no class member moves, and the next slice is a Resume-from hand-over on the card. pm:dispatched stays on the card (landing rule B).
  • Move, checked line by line (lines removed from approval-service.ts against lines added in the two new files):
    • 5 SLA constants go to approval-service/sla-constants.ts, and the run-liveness tables, types and two classifiers go to approval-service/run-liveness.ts. Both are leaf modules: they import only @objectstack/spec types and ./options.js.
    • Every removed line reappears verbatim except six formerly file-local symbols, which gain export so the class can import them: CONTINUATIONS_A_STATUS_CAN_ISSUE, STRANDABLE_REQUEST_STATUSES, STRANDED_CONTINUATION_KEY, TERMINAL_RUN_STATUSES, classifyStrandedRunState and refineFailedRunState. They are not re-exported from approval-service.ts, so the package surface does not widen.
    • The other additions are two headers, three type imports, the import blocks and the re-export blocks, which carry exactly the names exported before. Net +57 over a pure move, all accounted for.
  • Changeset, read sentence by sentence: true ("the package exports the same names with the same values and types").

@os-tesla
os-tesla marked this pull request as ready for review December 4, 2026 15:26
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvMXrDPhCt3pGziYWE

Landing · 2026-12-04T15:26Z · head e72994f975 · L1-b ACCEPT 7415855428 (no L2 owed)

Reading Result
check-governed-merges.mjs --pr 39727 NOT governed · 1,115 changed lines ≤ 3000
landing-k.mjs --pr 39727 K = 6 < 15
check-runs on e72994f975 39 success, 18 skip (the dogfood matrix placeholder /4 is unexpanded; its aggregator succeeded); mergeable_state clean
File surface inside claim amendment 7407330587 on #38665 (approval-service.ts, src/approval-service/**)

State: ready + auto-merge through the merge queue. Part of #38665 (slice 0a-2 under ruling 7310432861); the later slices go back to the queue with a Resume-from note after merge.

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 size/xl 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.

2 participants