Skip to content

fix(scenarios): prefix an operation's via with the card namespace - #37047

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36206-namespace-via
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36206-namespace-via

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Part of #36206

Clause-②: no
Metadata-protocol: none

repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

维护者速读

  • 用户能看到什么变化:用户无感;内部场景评测在打分时,能认出构建通过卡片自带动作完成的审批。
  • 为什么做:属于场景评测记分,修好上次修复的遗漏:卡片名字加前缀后,路由动作名没跟着加,所以从未匹配上。
  • 出错会怎样:只影响评测打分,不影响任何应用;可直接撤回。
  • 要你做什么:无

What changes

  • namespacedScenario (packages/qa/scenarios/src/runner/namespace.ts) now prefixes run.operations[].via with the card namespace, the same way it already prefixes run.agentActions[].name, and only when via is present.
  • Before: on the namespaced card a via stayed bare (decide_approval_step) while the action it names became demoleave_decide_approval_step, so the persona-grant check's buildDeclaresAction (src/score/scenario-tags.ts) never matched by ===, and persona-grant:dept_manager:*_approval_step:update failed on leave_balances, requisition_to_receipt and travel_expense although each build declares the action (eval comments 7087195956 and 7116578174 on the card).
  • Ruling 7077801044 item 3 (C) is unchanged; this only makes the namespaced card carry the route the ruling describes.
  • Part of, not Fixes: the card closes on an eval-lane re-run.

Tests

  • New pin in the existing namespace-relative cards block (packages/qa/scenarios/test/runner/units.test.ts): on every card that routes an operation (3 operations across leave_balances, requisition_to_receipt, travel_expense), the namespaced via is one of the namespaced run.agentActions on that operation's object — the loader's own rule, now holding on the namespaced card too; leave_balances reads demoleave_decide_approval_step; a card with no via gets none invented.
  • Red before the fix at the base commit: leave_balances manager_approves_step_one via decide_approval_step: expected false to be true.
  • Ablation after committing the fix (55cfe87): scripts/ablation-replace.mjs deleted the new line (anchor 1 -> 0, blob changed), the pin went red with the same message; restored with git checkout HEAD --, git diff HEAD empty and the blob hash matches HEAD.

Acceptance notes

  • Other readers of op.via: the loader (src/loader.ts ~928) validates the plain card before namespacing, and personaGrantNeeds (src/score/scenario-tags.ts ~990) reads the namespaced card; with both names prefixed together, the two agree.

Verification

  • Two-minute check: pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/units.test.ts -t 'namespace-relative' — expect 5 passed, including the new via pin.
  • Read first: packages/qa/scenarios/src/runner/namespace.ts (the one added line in the operations map).
Local readings

All at head 31083e7 (merge base b01d8f9; origin/main since moved, touching nothing under the scenarios package or the cards).

  • Package suite: pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios test under the verify lock: VERDICT command-exit 0, Test Files 42 passed (42), Tests 1325 passed (1325).
  • Typecheck: pnpm --filter @objectstack/scenarios typecheck: VERDICT command-exit 0.
  • Derived gates: dispatch-gates --commands named 60; 59 exit 0. check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET: needs every package's dist, whole-repo build not done locally) and reads NOT MEASURED; CI runs it. dispatch-gates --ran: 60 derived, 60 run, 0 unrun.
  • scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (origin/main merges cleanly; 0 open PR heads share a file).
  • test:repo not run locally (diff touches none of its tests); CI's Test Core runs it.

Generated by Claude Code

namespacedScenario prefixed run.agentActions[].name but copied operations[].via
bare, so the persona-grant scorer never found the routed action the build
declares (decide_approval_step vs demoleave_decide_approval_step).

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

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 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
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 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 — 1 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 a68b475bbc8ec7abdbb23c6e20781151a0335812 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json a68b475bbc8ec7abdbb23c6e20781151a0335812

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

Final head for L1 · 31083e7c152756b5a43b59d3299cdd8c54f8acc9 · 2026-11-24T17:59Z

  • Card Scenario scorer and card defects from the 18.6.0 gallery refresh (2026-11-21) #36206 (zone a4-A), Part of #36206: the card stays open for the eval-lane re-run its done-when names.
  • Check-runs on this head: 49, every one success or an expected skipped (the UI lanes by path filter); the required set is green.
  • Not governed (packages/qa/scenarios/**, one changeset), +32 / −0. It changes code, so its L1 is the seat session's, not the zone's self-review; requested from the seat at this stamp.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 31083e7c152756b5a43b59d3299cdd8c54f8acc9 · 2026-11-24T18:01Z

Requested by zone a4-A for card #36206 (scenario scorer defects); the seat session reviews.

  • Shape. Part of #36206 (the card keeps the eval lane's re-run; right). 3 files (+32): namespacedScenario in packages/qa/scenarios/src/runner/namespace.ts prefixes run.operations[].via with the same o(...) it applies to run.agentActions[].name, and only when via is present; one test; changeset @objectstack/scenarios patch, Clause-②: no, Metadata-protocol: none. Not governed.
  • Fix, read against the code. Before, a namespaced card carried agentActions[].name prefixed and operations[].via bare, so the grant check never matched the routed action (decide_approval_step vs demoleave_decide_approval_step). After, the loader's rule — a via is one of the card's agent actions on the operation's object — holds on the namespaced card as on the plain one. No via is invented where the card has none.
  • Test. Over the three routed cards (leave_balances, requisition_to_receipt, travel_expense): every via lands on a namespaced agent action of the same object (3 routed operations counted); leave_balances reads demoleave_decide_approval_step; the CRM card, which routes nothing, gains no via key. Red before the fix ("expected false to be true"); the one added line ablated turns it red again; restore blob-equal. Package 1325 tests, typecheck green.
  • Gates. Check-runs at this head: 33 success, 16 expected skip, 0 failed, 0 pending (pr-state.mjs --pr 37047).
  • No must-fix, no should-fix. The zone lands it and records the partial delivery on the card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

Landing · head 31083e7c152756b5a43b59d3299cdd8c54f8acc9 · 2026-11-24T18:02Z

Reading Result
check-governed-merges.mjs --pr 37047 NOT governed (0 of 3 paths on the register), 32 changed lines
landing-k.mjs --pr 37047 OK — K = 3 < 15, no locale pack, no shared budget book moved

State: L1 ACCEPT 7140047873 on this head; every check-run green or expected skip. Ready and auto-merge in this stroke. On MERGED, card #36206 is released with its remainder (the eval lane's 18.6.0 re-run).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 18:02
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 414f998 Nov 24, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36206-namespace-via branch November 24, 2026 18:22
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…igure (objectstack-ai#37624)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuRFAatVcx79d6cbkTpzPfYU)_

Part of objectstack-ai#36206

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:评测场景卡的评分器不再把回复里用排版连字符写的日期(如 2026‑09‑01)当成三个数字扣分,普通短横写法不变。
- 属于「评测与场景卡」专题,修画廊重跑里报出的一处误判:正确的拒答被判成「说了数据支撑不了的数」。
- 只影响评测打分,不碰平台运行时;出错最多是某轮评测分数读偏,撤回这个 PR 即恢复原样。
- 无。

## What changes

- `packages/qa/scenarios/src/score/scenario-run-grade.ts`: `ISO_DATE`,
the pattern `readingsIn` blanks before it reads a reply's figures, now
joins a date's parts by the ASCII hyphen or by the two Unicode hyphens a
typeset reply writes in its place (U+2010 hyphen, U+2011 non-breaking
hyphen). Before, only the ASCII hyphen matched, so a date written as
`2026`-U+2011-`09`-U+2011-`01` was read as the figures 2026, 9 and 1.
- One pin in the existing ISO-date block of
`test/score/scenario-run-grade.test.ts`: both hyphens read as a date,
and a figure range joined by U+2011 (`12`-U+2011-`15`) still reads as
two figures.
- One changeset, `@objectstack/scenarios` patch.

## Why

The 18.6.0 gallery re-run comment on the card (2026-11-22 22:56Z, item
2b evidence, "Minor") reports a reply that wrote `2026-09-01` with
U+2011 non-breaking hyphens, so `ISO_DATE` missed it and 9, 1 and 30
were read as figures. A correct decline is then graded "stated a figure
the data cannot support". The premise held at `origin/main` 54d6726
(`scenario-run-grade.ts:123`, pattern ASCII hyphen only).

Every other item of the card landed earlier: items 1, 2 (operands shown)
and 4-8 in objectstack-ai#36320; item 3 and PAY-0044 in objectstack-ai#36503 and objectstack-ai#37047; item 2b is
answered by the maintainer ruling recorded on the card (read C, no
grader change). This PR widens no total and does not touch that ruling:
it only keeps a date from being read as figures.

## Tests

<details><summary>Package suite, typecheck, ablation (head
0eb6af3)</summary>

- Through `os-verify-lock`: `pnpm --filter @objectstack/scenarios build
&& … typecheck && … exec vitest run --maxWorkers=2` → `VERDICT
command-exit 0`; Test Files 43 passed (43), Tests 1345 passed (1345).
- Ablation (`scripts/ablation-replace.mjs`, the test imports `src` by
relative path, so no dist leg): `ISO_DATE`'s two hyphen classes put back
to the ASCII `-`, anchor 1 → 0, blob `1854ffadf399` → `1ed8647e5c30`;
`test/score/scenario-run-grade.test.ts`: 1 failed | 88 passed, the
failing case being the new pin; restored blob `1854ffadf399` equals
HEAD, `git diff HEAD` empty. A first attempt was an anchor miss the tool
refused before running anything (the shell had turned the escape
spelling in the anchor into the characters), so it measured nothing; the
counted run built the anchor in a script.

</details>

## Acceptance notes

- `IDENTIFIER_TOKEN` still joins an identifier's parts by the ASCII `-`
and `_` only, so an id written with U+2011 (`INV`-U+2011-`003`) would
read its digits as a figure. No run has shown it; noted, not changed.
- The other observations on the card's re-run comments stay as they are,
with zero measured pull: the `via` on the two same-shaped decide
operations (asset_lifecycle `manager_approves_scrap`, order_to_cash
`approve_discount`), the asset_lifecycle 23/6 count (the card holds no
second source: its 30 laptops are 24 in use, 5 in stock, 1 in repair),
and per-group totals (the ruling refuses that widening).
- The card's done-when is a gallery re-run on 18.6.0, which belongs to
the eval lane; this PR does not close the card.

## Verification

- Two minutes: `pnpm --filter @objectstack/scenarios exec vitest run
test/score/scenario-run-grade.test.ts -t "Unicode hyphen"` → 1 passed.
- Read first: the `ISO_DATE` line in `scenario-run-grade.ts` (the only
behaviour change).

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind. (no new names)
- [x] 3. No formatter ran; `pnpm lint` passes. (CI)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgTESANUPsJKDqEn4zY)_

Co-authored-by: Claude <noreply@anthropic.com>
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/s 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.

2 participants