Repository navigation
FIX-2479 s6: the resource entry reads the whole tree - #4934
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Mechanism check (advisory, never blocks)Rows from
If an export is a new mechanism, add a row. CI filled the mechanical fields; - id: TODO
job: TODO
package: "@flow-state-dev/harness-manager"
anchor: readRunRecord
file: packages/harness-manager/src/run-record.ts
builtOn: [] # TODO
overlaps: [] # TODO
status: canonical
doc: TODO
- id: TODO
job: TODO
package: "@flow-state-dev/orchestration"
anchor: tasksInSession
file: packages/orchestration/src/tasks/helpers/session-rows.ts
builtOn: [] # TODO
overlaps: [] # TODO
status: canonical
doc: TODO |
|
"User docs change only at release" fails here, and this PR's own code isn't the cause. This branch merges in the commits from #4912 (the docs-fix PR that rewords 9 published lines). The whole-tree rule needs those lines reworded to reach OPEN 0. #4912 carries the Generated by Claude Code |
|
On the mechanism check: No Generated by Claude Code |
|
@codex review Two places I'm least sure of:
Generated by Claude Code |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67f681c65e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Code. A type declared with Row in its name, exported or not: Row is a store adapter's word, and a UI list's. | ||
| declaresRow: new RegExp(String.raw`(?<![\w$.])(?:type|interface|class|enum)\s+(${ROW_NAME})\s*(?:[<={]|extends\b|implements\b)`, "g"), | ||
| // Code. An exported value built on Row: `readRunRow`, `fooRowSchema`, `rowTruthOf`. A local is no name anyone meets. | ||
| exportsRow: new RegExp(String.raw`(?<![\w$.])export\s+(?:default\s+)?(?:declare\s+)?(?:async\s+)?(?:function\*?|const|let|var|class|enum)\s+(${ROW_NAME}|rows?[A-Z]\w*)`, "g"), |
There was a problem hiding this comment.
Check names exported through export lists
When a value is declared locally and then exported with export { readTaskRow }, neither matcher reports it: declaresRow excludes functions and variables, while exportsRow requires a declaration immediately after export. I verified that adding const readTaskRow = () => null; followed by export { readTaskRow }; to a tracked Workforce source file leaves the whole-tree guard passing with no resource-name hit. This lets a public retired name survive merely by changing the export syntax; inspect local export lists and exported aliases as well as directly exported declarations.
AGENTS.md reference: AGENTS.md:L14-L14
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in a7d0f21. The new exportsRowInList matcher counts a Row name that leaves a module through a local export list (const loadWidgetRow = …; export { loadWidgetRow }, single-line or multi-line, with or without type). It also counts an alias whose exported name is Row (export { x as loadWidgetRow }, re-exports included). A plain re-export (export { FooRow } from) stays uncounted, since its declaration is where the name counts. So does export { widgetRow as widget }, since a consumer meets widget. The tests failed before the fix and pass after. The whole-tree guard found nothing new from this matcher.
Generated by Claude Code
| /** A collection module: a `collection` directory, or a file whose name says collection. */ | ||
| const COLLECTION_FILE = /(?:^|\/)collections?(?:\/|$)|(?:^|\/)[^/]*collection[^/]*\.(?:[cm]?[jt]sx?|mdx?)$/i; | ||
| /** A name whose word parts include Row: `FooRow`, `Rows`, `RowHold`, `writeRunRow`. Not `Arrow`, `Rowan`. */ | ||
| const ROW_NAME = String.raw`\w*Row(?:s|[A-Z_]\w*)?(?![\w$])`; |
There was a problem hiding this comment.
Match plural Row word parts before another suffix
For names such as TaskRowsPage or readTaskRowsPage, the s alternative consumes only the plural marker, after which the negative lookahead rejects the remaining suffix; the other alternative cannot start with lowercase s. Consequently, both names produce zero hits outside the exempt paths, although the corresponding singular TaskRowPage is refused. I also verified that a tracked export type TaskRowsPage = { tasks: unknown[] }; leaves the full guard passing. Allow the plural marker before a subsequent word part so plural resource names cannot bypass the glossary rule.
AGENTS.md reference: AGENTS.md:L14-L14
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in a7d0f21. ROW_NAME is now \w*Rows?(?:[A-Z_]\w*)?(?[\w$]), so WidgetRowsPage and loadWidgetRowsPage count. Rowan and rowsetOf still don't. The tests failed before the fix and pass after. Against the whole tree, the change found two real names in packages/ui/stories/fixtures/workforce.ts. Both are collection reads, so I renamed them loadingResourcesSource and failingResourcesSource to match their sibling resourcesSource. The published UI-stories guide is on the changeset's Docs: worklist for the release.
Generated by Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0e1deaf76
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /** A name whose word parts include Row: `FooRow`, `Rows`, `RowHold`, `TaskRowsPage`, `writeRunRow`. Not `Arrow`, `Rowan`. */ | ||
| const ROW_NAME = String.raw`\w*Rows?(?:[A-Z_]\w*)?(?![\w$])`; | ||
| /** An export list's opening, read behind a name: `export {`, `export type {`, and any names before it in the list. */ | ||
| const IN_EXPORT_LIST = String.raw`(?<=(?<![\w$.])export\s+(?:type\s+)?\{[^}]*?)`; |
There was a problem hiding this comment.
Match export lists without an unbounded lookbehind
When scanning source with long stretches without }, this variable-length lookbehind rescans the preceding text at every character, making the export-list matcher quadratic even when no export list exists. On the tracked apps/docs/src/components/Landing/markup.ts, this matcher alone took approximately 7.6 seconds, versus 0.4–1.3 milliseconds for each other tree matcher. Because scanTreeRules applies it to every source file, this adds substantial latency to every pre-push vocabulary check (.husky/pre-push) and both guard runs in CI. Match export-list blocks forward and inspect their members instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 4b75af5. On apps/docs/src/components/Landing/markup.ts the old matcher took 4428 ms by itself. exportsRowInList is now rowNamesInExportLists, which finds each export {…} / export type {…} block forward once and checks its members. The rules haven't changed: a Row local in a list counts, an alias's exported name counts (re-exports included), and a plain export { FooRow } from doesn't. It now takes 0.2 ms on that file.
Checks:
- The existing export-list tests pass unchanged.
- The whole-tree guard passes, and so does its
--controlself-test. The full guard runs in 4.7 s. - The resource-names goal reports OPEN 0.
- A new test reads a long file with no export list in under 500 ms. Against the old matcher it took 37.5 s.
Generated by Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 664382c346
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Code. A type declared with Row in its name, exported or not: Row is a store adapter's word, and a UI list's. | ||
| declaresRow: new RegExp(String.raw`(?<![\w$.])(?:type|interface|class|enum)\s+(${ROW_NAME})\s*(?:[<={]|extends\b|implements\b)`, "g"), | ||
| // Code. An exported value built on Row: `readRunRow`, `fooRowSchema`, `rowTruthOf`. A local is no name anyone meets. | ||
| exportsRow: new RegExp(String.raw`(?<![\w$.])export\s+(?:default\s+)?(?:declare\s+)?(?:async\s+)?(?:function\*?|const|let|var|class|enum)\s+(${ROW_NAME}|rows?[A-Z]\w*)`, "g"), |
There was a problem hiding this comment.
Inspect every binding in exported variable declarations
When an exported variable declaration contains multiple bindings or destructuring, this matcher checks only an identifier immediately following const, let, or var. Using this commit’s scanTreeRules on a Workforce source path, export const readTaskRow = () => null; produces a hit, but export const version = 1, readTaskRow = () => null; and export const { readTaskRow } = helpers; both produce none. Neither form involves an export list, so the new list matcher cannot catch them either. This lets retired public resource names pass the whole-tree guard simply by changing declaration syntax; inspect all exported bindings rather than only the first declaration name.
AGENTS.md reference: AGENTS.md:L14-L14
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Half fixed in 55579ac, half left out of scope on purpose.
Destructuring: fixed. This form is in real use: six route files export const { GET, POST, … } = …. The new exportsRowInPattern walks exported object and array patterns, including nested ones, renames (key: target), defaults and rest elements, and counts the names they bind. For { widgetRow: widget }, the property read on the right side doesn't count; the bound name widget does. The tests failed before the fix and pass after. The whole-tree guard and its --control self-test pass, and the full run takes 4.2 s.
Several declarators in one export (export const a = 1, readTaskRow = …): left out. No such export exists in the tree. My search for the shape only matched default parameters inside arrow functions. Finding the second declarator means telling a declarator comma from commas inside the first initializer, which needs the initializer parsed. A regex can't do that reliably, and a misread here would report false hits on ordinary code. If this form ever turns up, the right fix is an AST pass over exports rather than another pattern.
Generated by Claude Code
Rewords the plain published lines that called a resource in a collection a row, so the resource entry can read the whole tree. The lines that quote the three released messages word for word are left for /release-docs (D4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
The task-board figure's alt text still called the tasks rows, one line after the sentence this PR reworded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
The glossary's resource entry turns from added lines to the whole tree (epic ER-6), widened to every Row, CollectionItem and lifecycle-State name above the store adapters and UI lists. Its exemptions are the store-adapter and UI-list path rules and D4's released quotes, which strip a quoted message's text on a published page, never the line. The guard scans every in-scope file for it and refuses plants in five packages under --control. What the widened rule found is renamed: lifecycles say Status (SessionConnectionStatus, AudioPlayerStatus, ResourceIndexBuildStatus, the registry's ToolStatus and ConnectionFeedStatus), the schedule index's entry is ScheduleIndexEntry, harness-manager's run-record helpers say Record, rowsInSession is tasksInSession, and labs, tests and model lists drop Row. Adds the goal goals/vocabulary/resource-names/a-consumer-meets-one-word/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
… parity reads the move's commit ToolStatus has no consumer outside the tool card, in the registry or its installed copies, so it is not exported (the registry test derives it from getStatusBadge). The copies stay byte-equal to the registry. retire-a-word-in-one-place's parity leg compared the pre-move check files with the current ones on HEAD, which FIX-2354 already made differ by its intended widening (FAIL at origin/main too). It now reads the move's own commit, where the claim it makes, that the move lost no rule, is checkable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
dispatched-work.md called a task a row throughout; a task is a task, and an owner run's stored thing is a resource. The same wording goes in action-forms, architecture-reference, execution-and-errors, resource-collections, resources-and-client-data, scheduled-actions, state-and-scopes and the Workforce worker-flow notes. Row stays where it means a store's row or a table's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…vidence counts what it compares Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
… parts
Codex found two ways past the resource entry: a Row name exported through
`export { readTaskRow }` or an alias, and a plural part before another
(`TaskRowsPage`). Both now count. The plural fix found two story fixtures
named for collection reads; they say resources, like their sibling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…ree Row matchers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
The export-list matcher looked behind for `export {` at every character, so
a long file with no list cost quadratic time (4.4 s on Landing/markup.ts).
It now finds each list once and checks its members: same hits, 0.2 ms there.
A test reads a long list-free file under 500 ms (37.5 s with the old matcher).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…inds
Codex: `export const { readTaskRow } = helpers` passed the guard. A new
matcher walks exported object and array patterns (nested, renamed, with
defaults) and counts the names they bind, not the properties they read.
Several declarators in one export stay out of scope: none exist, and
reading them needs the initializers parsed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
… member Gitar: the forward export-list reader dropped a member with a line or block comment in front of it, which the lookbehind it replaced had caught. Comments are blanked (same length) before the members are read, in lists and patterns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
5480905 to
96ea5f2
Compare
CI failed: The user-documentation scope validator (scripts/validate-user-docs-scope.mjs) exited with code 1 across 5 logs, likely because the PR's documentation edits aren't classified under the release-docs policy (the `docs-fix` label is missing); the log omits the specific diagnostic, so this is medium confidence.OverviewOne unique error template appeared across 12 analyzed logs, with 5 logs in the matched template (job 128763327256). The rest of the template output is git init/branch noise and warnings, which were excluded. Overall assessment: a single configuration-type failure tied to the PR's documentation changes, with the root cause only partially evidenced. FailuresUser-documentation scope validator rejected the PR (confidence: medium)
Summary
Code Review ✅ Approved 5 closed / 5 findings🔴 High risk · Renaming exported client and engine types removes existing API names, which could break downstream consumers that still import them. Widens the ✅ 5 closed✅ Quality: Parity leg now ignores --at, so its non-vacuity control can't reach it
✅ Quality: New verdict row says 20 control verdicts, 'as in' a row that says 21
✅ Quality: New matcher's insertion leaves misplaced/stale docs
✅ Bug: Export-list reader skips any member with a comment in front of it
✅ Bug: Destructuring-export reader misses a member that has a comment before it
VerificationRules No rules evaluated Functional validation Not enabledFor more verification details, comment Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Stacks on #4931 (
fix/FIX-2479-s5-workforce-shift-manager, top of #4913 → #4915 → #4926 → #4930 → #4931), and includes #4912's commits (thedocs-fixrewording of 9 published lines), merged in with a merge commit, because the whole-tree rule reads those lines. Final slice (s6) of FIX-2479, epic FIX-2600.What this does
The glossary's resource entry (
collection-row) now reads the whole tree, not only the lines a change adds (epic ER-6). It is widened so it finds anything left:readRunRow,fooRowSchema,rowTruthOf), any name built on CollectionItem (a use as well as a declaration), and a lifecycle named State (a string-literal union on one line or several, or az.enum);Its only exemptions: the store-adapter path rule, the UI-list path rule (
components/orsurfaces/), and D4's released quotes, which strip the three released message texts on published pages (apps/docs/{docs,guides},packages/*/README.md), the text and not the line. The old table-row name and line exemptions are gone; the path rule replaces them. No D2 exemption was needed.The rule lives only in
docs/contributing/glossary.mjs. The guard (scripts/check-retired-terms.mjs) changed its mechanism only: it scans every in-scope file for atreerule, counts a stale tree exemption, and its--controlplants aFooRowtype (orchestration, workforce), auseFooCollectionItemexport (client), an exportedreadFooRow(harness-manager), a lifecycleFooState(workspace), a page's "collection row", and a second row on a released-quote line. The added-lines diff code and CI's base-branch fetch step, both now unused, are removed.What the widened rule found, and how each was resolved
All renamed; nothing new exempted.
clientSessionConnectionStateSessionConnectionStatusreactAudioPlayerState,AudioRecorderStateAudioPlayerStatus,AudioRecorderStatusengineResourceIndexBuildStateResourceIndexBuildStatusscheduledScheduleIndexRowScheduleIndexEntryharness-managerreadRunRow/openRunRow/writeRunRow, internalCollectionRowreadRunRecord/openRunRecord/writeRunRecord,ReadResourceorchestration/internalrowsInSession; internalHeldRow,RequestStatetasksInSession;HeldTask,RequestStanding(notRequestStatus, which core already exports with other values)ToolState,ToolStepState,ConnectionFeedStateToolStatus,ToolStepStatus,ConnectionFeedStatusTaskState,CallStateSquareStatus,CallStatusRowActionOutcome; engineListedRowTaskActionOutcome;ListedRecordStoredRow,ScheduleRow,ThreadIndexRow,RoleRowStoredTask,StoredSchedule,ThreadIndexResourceState,RoleSpecSdkModelRow,ModelRow,VariantRowSdkModelEntry,ListedModel,ListedVariantPlanRowItem,PlanRowStage,planRowStagePlanEntry,PlanEntryStage,planEntryStageSessionRow,ProjectRow,TaskRow,WorkerRow,TalkRow,HarnessRow,holdsOfRows,rowAttention,taskRowPresentation, …)LabSession,LabProject,LabTask,LabWorker,LabTalk,LabHarness,holdsOfTasks,teammateAttention,taskPresentationrowsSource,rosterRow,boardRowresourcesSource,rosterWorker,boardTasktype RowshapesStoredTask,Listed,Case,Versioned, …docs/architecture/resources-and-client-data.mdquoting the old owner-writes messageEvery new name was checked against
docs/contributing/glossary.mjsandgoals/**/rules.mjs; none is retired. Goals that import a renamed name, or patch a line that holds one, were updated to match. Merged the latest s5 head (ticketStillRunsTask, Roster'sWorkerRowkept): noticketClaimsTaskis left.Changeset
.changeset/resource-names.md(minor) gains the rows above for published packages. ItsDocs:line now names every published page and README that still uses an old name or value, page by page, from a sweep ofapps/docs/{docs,guides}andpackages/*/README.mdfor every old name in its tables. Added beyond the earlier line:packages/workforce/README.md(listCollectionItems),guides/writing-ui-stories.md,docs/client/overview.md,docs/workforce/{delegating-work,inventory,ui}.md,docs/orchestration/task-board.md,docs/advanced/concurrency-policies.md,docs/server/background-work.md,guides/keeping-a-flow-running.md,docs/server/schedule-index.md,guides/scheduled-dynamic.md, and the claude-code and cursor READMEs. No user doc is edited here.DevTool's task-collection-state: checked
waitPromptinpackages/devtool/src/react/lib/task-collection-state.tstreats any hold whosesource.kindis not"suspension"as the task's own, open until a steer carries its id. It is still correct under the current kinds.taskHoldSchemahas two sources:"suspension"and"task". The only other value a stored hold can carry is the retired"row", which is the task's own hold and reads as"task"(D1). So "not suspension" is exactly "the task's own" for every value written or read, and the DevTool keeps no dependency on orchestration. One observation, outside this issue: anexternalwait (actor: "system") is also a task's own hold, sowaitPromptshows its prompt as what the task "waits on a person for". That comes from the actor, not the source kind.Goal verdict
goals/vocabulary/resource-names/a-consumer-meets-one-word/(model-free):mainwere each reported.--controlrefused FooRow in orchestration and workforce, and useFooCollectionItem in client. The exemptions are store-adapter-rows, ui-list-rows and released-quotes. A question and a confirm stored as"row"were listed as["task"], answered throughupdateTask, with 0 open after.--at origin/main(e4c37df): FAIL as expected. OPEN 475, with the open names listed.GOAL_CONTROL=no-row-read: FAIL as expected onhold:.openread 0 only because the rule read added lines.reaches,controlandexemptionsall failed.Checks run
node scripts/check-retired-terms.mjs: PASS (exemptions kept: store-adapter-rows 10, ui-list-rows 36, released-quotes 6).--control: CONTROL PASS.node goals/vocabulary/one-word-per-thing/sweep.mjs: PASS, OPEN 0.node scripts/check-root-exports.mjs origin/main: PASS.node goals/workforce-coordination/runs-on-one-task/sweep.mjs: PASS.pnpm typecheck: 77/77, plus the boundary, updater-purity and side-chain validators.getAssetPath()test needsdist-clientbuilt, which this checkout doesn't have.Follow-up pushes
ToolStatus(the tool card's lifecycle, in the ui registry and its two installed copies) is module-local: nothing outside the card used it, and Fallow's new-dead-code check flagged the renamed export. The copies stay byte-equal to the registry.goals/vocabulary/one-glossary/retire-a-word-in-one-place(FIX-2601): its parity leg was already FAIL onorigin/main, because FIX-2354 widened the glossary after the move. Parity now reads the move's own commit,a3655381e. PASS: hits 1617 · kept 1570 · OPEN 0, 18 guard count lines and 20 control verdicts equal. The lever leg still runs at HEAD with the whole-tree guard.dispatched-work.md, plus 16 across action-forms, architecture-reference, execution-and-errors, resource-collections, resources-and-client-data, scheduled-actions, state-and-scopes and workforce-default-worker-flow. Row stays where it means a store's row or a table's.Left open
/release-docs.https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
Generated by Claude Code