Remove flat exports, enforce namespace-only imports (BREAKING CHANGE) - #63
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
|
@copilot 既然您不需要考虑向后兼容性,目前的 PR 实现(保留了 您应该直接删除 以下是具体的处理建议: 1. 修改
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Done! I've removed all flat exports from Changes made (commit fb3126a):
This completely eliminates the risk of naming conflicts by enforcing clear namespace boundaries. All types must now be accessed through protocol namespaces. |
Fixed! Updated all imports in packages and examples to use the new namespace structure (commit 2cfa7e7). Changes:
CI build, test, and typecheck should now pass. |
|
@copilot fix |
|
@copilot and fix build |
| @@ -1,4 +1,4 @@ | |||
| import { QueryAST, FilterNode, SortNode, AggregationNode, WindowFunctionNode } from '@objectstack/spec'; | |||
| import { QueryAST, FilterNode, SortNode, AggregationNode, WindowFunctionNode } from '@objectstack/spec/data'; | |||
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 8 months ago
In general, to fix an unused import, either remove it if it's not needed, or start using it in the code if it was meant to be used. Since there is no sign that WindowFunctionNode is required for existing functionality and no references to it appear in the snippet, the safest, non-functional change is to delete just that symbol from the import list.
Concretely, in packages/client/src/index.ts, edit the import on line 1 to remove WindowFunctionNode from the destructuring while leaving the other imported types intact. No additional imports, methods, or definitions are needed, and this change will not affect runtime behavior because type-only imports are erased at compile time, and this one was unused anyway.
| @@ -1,4 +1,4 @@ | ||
| import { QueryAST, FilterNode, SortNode, AggregationNode, WindowFunctionNode } from '@objectstack/spec/data'; | ||
| import { QueryAST, FilterNode, SortNode, AggregationNode } from '@objectstack/spec/data'; | ||
|
|
||
| export interface ClientConfig { | ||
| baseUrl: string; |
| QueryAST, | ||
| QueryInput | ||
| } from '@objectstack/spec'; | ||
| import { QueryAST, QueryInput } from '@objectstack/spec/data'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 8 months ago
In general, to fix an unused import, you either (a) start using it meaningfully in the module, or (b) remove it from the import list. Since there is no evidence that QueryAST should be used (no related logic exists in the shown code), the safest and least intrusive fix is to remove only QueryAST from the import declaration while keeping QueryInput as-is.
Concretely, in packages/driver-memory/src/memory-driver.ts at line 1, change the import from destructuring both symbols to importing only QueryInput. No other lines or imports need to be touched, and no additional methods or definitions are required. This preserves existing functionality while resolving the unused-import warning.
| @@ -1,4 +1,4 @@ | ||
| import { QueryAST, QueryInput } from '@objectstack/spec/data'; | ||
| import { QueryInput } from '@objectstack/spec/data'; | ||
| import { DriverInterface, DriverOptions } from '@objectstack/spec/system'; | ||
|
|
||
| /** |
Could you please clarify what needs to be fixed? Current status:
Are there specific CI failures, build errors, or test failures you're seeing that I should address? |
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Fixed! The build was failing because Changes:
Build should now pass successfully. |
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
…e the AGENTS.md ceiling 1058 -> 1068 (ruled) The rules-only rewrite of `AGENTS.md` landed while this branch was open, so the bullet this branch adds is re-typeset into that voice: the incident clause "and it has already cost a seat a round trip" comes out, and the rest is re-wrapped to the surrounding block's own prose width (widest added line 90 bytes, against 90 bytes widest in the §11 block around it; the gate's hard cap is 120). Every rule sentence stays, because each is ruled substance: a local `merge-tree` of a `merge=os-regen` path runs the same merge-ort machinery as `git merge` and therefore honours the custom driver while GitHub runs none, so the two answer different questions about the same snapshot; the sound probe is a throwaway bare clone that shares the object store with no driver registered, with both of its commands; and the `-c merge.os-regen.driver=` override is refused, with the reason it is refused — it does not disable the driver, it leaves git failing to run it and reporting a conflict for every routed path, including ones that text-merge cleanly. The bullet measures +10 lines against `origin/main`, taking `AGENTS.md` to 1068, so the `CEILINGS` entry moves 1058 -> 1068 at the landed count, headroom 0. That raise is the header's own escape hatch and it is ruled: maintainer, decision batch #63, 2026-09-07, verbatim and untranslated 「同意」 (PR #15885 comment 5564103435), and 「15885 你接手跟进合并」 (2026-09-07, quoted in the correction comment on the same PR, which re-measures the number the batch stated as 1171 against a `main` that had since moved). Re-wrap funding and a cross-file move were both refused per that header: the bullet is already at the block's prose width, and `AGENTS.md` is not a `CROSS_FILE_MOVES` destination, so no `ruledRaises` record applies. The widest-table-row leg (pin 768) and every other ceiling are untouched. Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH Co-authored-by: Claude <noreply@anthropic.com>
…mergeability — state the corollary and name the sound probe (objectstack-ai#15871) (objectstack-ai#15885) * docs(agents): state the corollary that a local `merge-tree` of an os-regen path is not GitHub mergeability, and name the sound probe (objectstack-ai#15871) AGENTS.md §11 already says the `merge=os-regen` driver is a LOCAL facility. What it never stated is the corollary that costs a seat a round trip: a local `git merge-tree` of a routed path runs the same merge-ort machinery as `git merge`, so it HONOURS the driver, while GitHub runs none — the two answer different questions about the same snapshot. The added bullet names the sound instrument (a throwaway bare clone sharing the object store, where the driver is genuinely absent, which is GitHub's actual condition) and refuses the falsified `-c merge.os-regen.driver=` spelling, whose empty string does not disable the driver but leaves git failing to run it and reporting a conflict for every routed path — including ones that text-merge cleanly. Measurements are on PR objectstack-ai#15868, which carries the same text in `scripts/pm/os-regen-merge.sh`'s header. Part of objectstack-ai#15815 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk * docs(agents): re-typeset the merge-tree corollary rules-only and raise the AGENTS.md ceiling 1058 -> 1068 (ruled) The rules-only rewrite of `AGENTS.md` landed while this branch was open, so the bullet this branch adds is re-typeset into that voice: the incident clause "and it has already cost a seat a round trip" comes out, and the rest is re-wrapped to the surrounding block's own prose width (widest added line 90 bytes, against 90 bytes widest in the §11 block around it; the gate's hard cap is 120). Every rule sentence stays, because each is ruled substance: a local `merge-tree` of a `merge=os-regen` path runs the same merge-ort machinery as `git merge` and therefore honours the custom driver while GitHub runs none, so the two answer different questions about the same snapshot; the sound probe is a throwaway bare clone that shares the object store with no driver registered, with both of its commands; and the `-c merge.os-regen.driver=` override is refused, with the reason it is refused — it does not disable the driver, it leaves git failing to run it and reporting a conflict for every routed path, including ones that text-merge cleanly. The bullet measures +10 lines against `origin/main`, taking `AGENTS.md` to 1068, so the `CEILINGS` entry moves 1058 -> 1068 at the landed count, headroom 0. That raise is the header's own escape hatch and it is ruled: maintainer, decision batch objectstack-ai#63, 2026-09-07, verbatim and untranslated 「同意」 (PR objectstack-ai#15885 comment 5564103435), and 「15885 你接手跟进合并」 (2026-09-07, quoted in the correction comment on the same PR, which re-measures the number the batch stated as 1171 against a `main` that had since moved). Re-wrap funding and a cross-file move were both refused per that header: the bullet is already at the block's prose width, and `AGENTS.md` is not a `CROSS_FILE_MOVES` destination, so no `ruledRaises` record applies. The widest-table-row leg (pin 768) and every other ceiling are untouched. Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
Plan: Fix CI Build, Test, and TypeCheck Issues ✅ COMPLETE
Problem
After removing flat exports, the build-schemas.ts script failed because it expected flat exports but now receives namespace exports (Data, UI, System, AI, API).
Changes Made
Build Script Fixes:
packages/spec/scripts/build-schemas.tsto iterate through namespace exportsHow it works:
Previous Updates
Packages Updated:
packages/client/src/index.ts- Data protocol importspackages/objectql/src/registry.ts- Data, UI, System importspackages/objectql/src/index.ts- Data and System importspackages/runtime/src/kernel.ts- Data protocol importspackages/driver-memory/src/memory-driver.ts- Data and System importspackages/driver-memory/objectstack.config.ts- System importsExamples Updated:
Benefits
Files Changed: 35 files (34 source files + 1 build script)
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.