SRE-1034: Reference a package's own tasks by bare name in task-dependencies.json - #9551
Conversation
`build:types`, `build:wasm` and `build:openapi` depended on `^build` so that a change in an upstream crate reaches their hash and `affectedTasks`. For a crate's mirror package `build` is a no-op today, but under `futureFlags.experimentalCargoWorkspaces` it becomes `cargo build`, and the chain would compile every upstream crate before generating types. `manifest` is a task nothing implements. Depending on `^manifest` folds the inputs of every transitive dependency into the hash and keeps `affectedTasks` walking the chain, while running nothing: a change in `error-stack`, two levels up, moves `@rust/hash-codec#build:types` from 5b22f4cb to 8145afd3 and still selects the sibling `@blockprotocol/type-system` package. The one edge that disappears from the documents is `hash-graph-api#build:openapi` waiting for `@local/status#build`. The mirror of the crate `hash-status` lists the TypeScript `@local/status` as its only dependency, so `^build` reached a `tsc --build` two tasks without a command away.
The client's codegen and the hickory binding's build depended on the crates' `build`, a task neither crate has, and carried TODO markers for it. They now depend on the crates' `manifest`, so a change in the crate still selects the package without asking it for a build.
Three files import the `Status` type from `@local/status`, which the package never declared. Its build had still run first, reached through `@local/hash-graph-client#codegen → @rust/hash-graph-api#build → @rust/hash-status#build → ^build`, a chain of tasks that do not exist. The manifest edge no longer walks it, and `tsc` found no declarations.
`import/no-extraneous-dependencies` skips `import type` unless `includeTypes` is set, so a package could import types from a package it never declared and resolve them through hoisting or a dependency's build. The rule now checks type imports everywhere, with the `devDependencies` globs `eslint-config-airbnb-base` had supplied. Three packages had such imports and now declare them: the API and the AI worker import the internal API client's types, both workers the Temporal client's, and the AI worker also imports from `@blockprotocol/core`. The API's and the AI worker's tasks now run the internal API client's build before them instead of relying on the backend utils to pull it in.
`includeTypes` on `import/no-extraneous-dependencies` also applied airbnb's split between `dependencies` and `devDependencies` to type imports, so a type used in nothing but a cast had to move into `dependencies`. The plugin is registered a second time as `import-declared`, and that instance of the rule runs with `devDependencies: true` and `includeTypes: true`: it asks whether an import is declared at all. The original rule keeps its options for value imports, and the package configurations that override it leave the second instance in place. Two imports of a package by its own name become relative imports, and the AI worker declares the `vite` its vitest config had imported behind a disable directive.
A document listed every predecessor as `<package>#<task>`, repeating the package for its own tasks on every line. Those are now listed by their bare name, the way `turbo.json` refers to them; tasks of other packages keep their id. Re-expanding the bare names yields the previous documents for every package.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The Reviewed by Cursor Bugbot for commit 7998e7d. Bugbot is set up for automated code reviews on this repo. Configure here. |
Merging this PR will not alter performance
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
as_constant |
< 1 ns | < 1 ns | N/A | |
constant_equal |
< 1 ns | < 1 ns | N/A | |
constant_not_equal |
< 1 ns | < 1 ns | N/A | |
access |
< 1 ns | < 1 ns | N/A | |
runtime_equal |
< 1 ns | < 1 ns | N/A | |
runtime_not_equal |
< 1 ns | < 1 ns | N/A |
Comparing t/sre-1034-reference-a-packages-own-tasks-by-bare-name-in-task (7998e7d) with t/sre-989-carry-crate-source-hashes-without-a-build (c0decf5)
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes have no unresolved approval-blocking issues.
Pull request overview
Updates task-dependency documentation to use bare names for same-package prerequisites while retaining qualified cross-package IDs.
Changes:
- Adds own-package task-name normalization to the Rust generator.
- Regenerates 25 dependency documents without changing graph edges.
File summaries
| File | Description |
|---|---|
tests/hash-playwright/docs/task-dependencies.json |
Normalizes local codegen references. |
tests/hash-backend-integration/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@local/repo-chores/rust/src/task_dependencies/mod.rs |
Implements local task-name normalization. |
libs/@local/repo-chores/rust/docs/task-dependencies.json |
Normalizes local build references. |
libs/@local/petrinaut-python/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@local/petrinaut-optimizer-client/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@local/hash-isomorphic-utils/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@local/graph/store/typescript/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@local/graph/client/typescript/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@local/graph/authorization/typescript/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@local/eslint/docs/task-dependencies.json |
Normalizes local build references. |
libs/@local/effect-dns/hickory/typescript/docs/task-dependencies.json |
Normalizes local build references. |
libs/@local/codec/typescript/docs/task-dependencies.json |
Normalizes local codegen references. |
libs/@hashintel/petrinaut-cli/docs/task-dependencies.json |
Normalizes local build and codegen references. |
libs/@hashintel/ds-components/docs/task-dependencies.json |
Normalizes same-package prerequisites. |
libs/@blockprotocol/type-system/typescript/docs/task-dependencies.json |
Normalizes local codegen references. |
apps/plugin-browser/docs/task-dependencies.json |
Normalizes local codegen references. |
apps/petrinaut-website/docs/task-dependencies.json |
Normalizes local generation tasks. |
apps/petrinaut-opt/docs/task-dependencies.json |
Normalizes local codegen references. |
apps/petrinaut-docs/docs/task-dependencies.json |
Normalizes local bundle-sync references. |
apps/hash-integration-worker/docs/task-dependencies.json |
Normalizes local build references. |
apps/hash-graph/docs/task-dependencies.json |
Normalizes local startup prerequisites. |
apps/hash-frontend/docs/task-dependencies.json |
Normalizes local build and codegen references. |
apps/hash-api/docs/task-dependencies.json |
Normalizes local startup and codegen references. |
apps/hash-ai-worker-ts/docs/task-dependencies.json |
Normalizes local build references. |
apps/brunch-agent/docs/task-dependencies.json |
Normalizes the local build reference. |
Review details
- Files reviewed: 26/26 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Benchmark results
|
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| resolve_policies_for_actor | user: empty, selectivity: high, policies: 2002 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: medium, policies: 1002 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: high, policies: 3314 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: medium, policies: 1527 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: high, policies: 2078 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: medium, policies: 1033 | Flame Graph |
policy_resolution_medium
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| resolve_policies_for_actor | user: empty, selectivity: high, policies: 102 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: medium, policies: 52 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: high, policies: 269 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: medium, policies: 108 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: high, policies: 133 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: medium, policies: 63 | Flame Graph |
policy_resolution_none
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| resolve_policies_for_actor | user: empty, selectivity: high, policies: 2 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: medium, policies: 2 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: high, policies: 8 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: medium, policies: 3 | Flame Graph |
policy_resolution_small
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| resolve_policies_for_actor | user: empty, selectivity: high, policies: 52 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: empty, selectivity: medium, policies: 26 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: high, policies: 94 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: seeded, selectivity: medium, policies: 27 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: high, policies: 66 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: low, policies: 1 | Flame Graph | |
| resolve_policies_for_actor | user: system, selectivity: medium, policies: 29 | Flame Graph |
read_scaling_complete
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id;one_depth | 1 entities | Flame Graph | |
| entity_by_id;one_depth | 10 entities | Flame Graph | |
| entity_by_id;one_depth | 25 entities | Flame Graph | |
| entity_by_id;one_depth | 5 entities | Flame Graph | |
| entity_by_id;one_depth | 50 entities | Flame Graph | |
| entity_by_id;two_depth | 1 entities | Flame Graph | |
| entity_by_id;two_depth | 10 entities | Flame Graph | |
| entity_by_id;two_depth | 25 entities | Flame Graph | |
| entity_by_id;two_depth | 5 entities | Flame Graph | |
| entity_by_id;two_depth | 50 entities | Flame Graph | |
| entity_by_id;zero_depth | 1 entities | Flame Graph | |
| entity_by_id;zero_depth | 10 entities | Flame Graph | |
| entity_by_id;zero_depth | 25 entities | Flame Graph | |
| entity_by_id;zero_depth | 5 entities | Flame Graph | |
| entity_by_id;zero_depth | 50 entities | Flame Graph |
read_scaling_linkless
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | 1 entities | Flame Graph | |
| entity_by_id | 10 entities | Flame Graph | |
| entity_by_id | 100 entities | Flame Graph | |
| entity_by_id | 1000 entities | Flame Graph | |
| entity_by_id | 10000 entities | Flame Graph |
representative_read_entity
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1
|
Flame Graph | |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1
|
Flame Graph |
representative_read_entity_type
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| get_entity_type_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba
|
Flame Graph |
representative_read_multiple_entities
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_property | traversal_paths=0 | 0 | |
| entity_by_property | traversal_paths=255 | 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true | |
| entity_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false | |
| entity_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true | |
| entity_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true | |
| entity_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true | |
| link_by_source_by_property | traversal_paths=0 | 0 | |
| link_by_source_by_property | traversal_paths=255 | 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true | |
| link_by_source_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false | |
| link_by_source_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true | |
| link_by_source_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true | |
| link_by_source_by_property | traversal_paths=2 | 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true |
scenarios
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| full_test | query-limited | Flame Graph | |
| full_test | query-unlimited | Flame Graph | |
| linked_queries | query-limited | Flame Graph | |
| linked_queries | query-unlimited | Flame Graph |
🌟 What is the purpose of this PR?
The checked-in
docs/task-dependencies.jsonlist every predecessor as<package>#<task>, including the package's own tasks. Those now appear by their bare name, the wayturbo.jsonrefers to them, which makes a document read as "devrunscodegenfirst" rather than repeating the package on every line.🔗 Related links
🔍 What does this change?
"@apps/hash-api#codegen"under@apps/hash-apibecomes"codegen"); tasks of other packages keep their full id.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
None.
🐾 Next steps
None.
🛡 What tests cover this?
The documents are regenerated and diffed in CI (
Validate Task Dependencies). Verified locally that re-expanding every bare name with its package yields exactly the previous documents.❓ How to test this?
turbo run //#doc:task-dependencies; the working tree stays cleanapps/hash-api/docs/task-dependencies.json;devlistscodegen,startlistsstart:migrate