@nimiplatform/nimi-coding 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/cli/constants.mjs +1 -1
- package/cli/dev/run-suite.mjs +16 -11
- package/cli/lib/code/context.mjs +14 -6
- package/methodology/core.yaml +1 -1
- package/package.json +5 -1
- package/spec/code-context.yaml +3 -1
- package/spec/product-scope.yaml +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.6.5
|
|
6
|
+
|
|
7
|
+
- Expanded `code context` from an exact TypeScript 5.9.3 pin to stable project-local TypeScript 5.9.3 through 6.x. Responses and TypeScript library loci report the loaded compiler version; metadata mismatches, prereleases, unsupported major versions, and missing public capabilities still refuse the query.
|
|
8
|
+
- Run the code-context contract suite against TypeScript 5.9.3, 6.0.2, and 6.0.3.
|
|
9
|
+
|
|
5
10
|
## 0.6.4
|
|
6
11
|
|
|
7
12
|
- Made experimental `code context` declaration ordering independent of the host locale, using UTF-16 code-unit text order followed by numeric source positions.
|
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ Projects own all product meaning. Nimi Coding admits, locates, relates, and deri
|
|
|
62
62
|
| Change intelligence | Stable-ID semantic diff, change-derived active-survivor recall, and relation-derived impact obligations | Candidate completeness is scoped to explicit channels; impact accepts no disposition or completion state |
|
|
63
63
|
| Deterministic audit | Project-owned bindings for the graph verifier and exact lexical invariants, with JSON and SARIF 2.1.0 | Exact case-sensitive token/phrase checks only; no synonym, embedding, or natural-language contradiction inference |
|
|
64
64
|
| Git-aware review | Immutable base commit plus exact, race-checked current worktree snapshot composed through compile/diff/impact/audit | Read-only; business semantics and implementation conformance are explicitly `not_evaluated` |
|
|
65
|
-
| TypeScript code context | Root declaration source plus root-direct static bindings, portable declaration loci, and eligible target source slices | Explicit `.ts`/`.tsx` root and tsconfig
|
|
65
|
+
| TypeScript code context | Root declaration source plus root-direct static bindings, portable declaration loci, and eligible target source slices | Explicit `.ts`/`.tsx` root and tsconfig; stable project-local TypeScript 5.9.3 through 6.x; actual compiler version reported; outbound only; no locating, inbound impact, runtime dispatch, or task-completeness claim |
|
|
66
66
|
| Explicit code-authority links | Transient Authority→Code, Code→Authority, and lifecycle audit over optional exact markers in tracked current `.ts`, `.tsx`, `.go`, `.py`, and `.rs` source | Marker location only; no declaration ownership, annotation coverage, implementation conformance, or unannotated legacy detection |
|
|
67
67
|
|
|
68
68
|
The current Nimi-realm validation corpus contains 33 canonical containers, 2,212 authority units, and 2,159 authored relations. Those figures demonstrate a real large-corpus replay; they are not package limits or a claim that the grammar covers every possible domain.
|
package/README.zh-CN.md
CHANGED
|
@@ -62,7 +62,7 @@ AI host · 第三方扩展 · CI · future editor/UI surfaces
|
|
|
62
62
|
| Change intelligence | Stable-ID semantic diff、change-derived active-survivor recall 和 relation-derived impact obligations | Candidate completeness 只覆盖显式 channels;impact 不接受 disposition 或 completion state |
|
|
63
63
|
| Deterministic audit | Project-owned graph verifier 与 exact lexical invariant bindings,输出 JSON 和 SARIF 2.1.0 | 只做大小写敏感的 exact token/phrase 检查;不做 synonym、embedding 或自然语言矛盾推断 |
|
|
64
64
|
| Git-aware review | Immutable base commit 加 exact、race-checked current worktree snapshot,并复用 compile/diff/impact/audit | 只读;business semantics 与 implementation conformance 固定为 `not_evaluated` |
|
|
65
|
-
| TypeScript code context | Root declaration source、root-direct static bindings、portable declaration loci 和符合条件的 target source slices | 明确的 `.ts`/`.tsx` root 与 tsconfig
|
|
65
|
+
| TypeScript code context | Root declaration source、root-direct static bindings、portable declaration loci 和符合条件的 target source slices | 明确的 `.ts`/`.tsx` root 与 tsconfig;使用项目本地稳定版 TypeScript 5.9.3 至 6.x,并报告实际编译器版本;仅 outbound;不承诺 locating、inbound impact、runtime dispatch 或 task completeness |
|
|
66
66
|
| 显式 code-authority 链接 | 对 Git tracked 当前 `.ts`、`.tsx`、`.go`、`.py`、`.rs` 源码中的可选 exact marker 提供 transient Authority→Code、Code→Authority 和 lifecycle audit | 只声明 marker location;不声明 declaration ownership、annotation coverage、implementation conformance 或未标注 legacy detection |
|
|
67
67
|
|
|
68
68
|
当前 Nimi-realm 验证 corpus 包含 33 个 canonical containers、2,212 个 authority units 和 2,159 条 authored relations。这些数字证明了真实大型 corpus replay,不是 package 上限,也不代表 grammar 已覆盖所有领域。
|
package/cli/constants.mjs
CHANGED
package/cli/dev/run-suite.mjs
CHANGED
|
@@ -3,15 +3,20 @@ import path from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
5
|
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
const suites = [
|
|
7
|
+
{ compiler: "typescript", args: ["--test"] },
|
|
8
|
+
{ compiler: "typescript-6-0-2", args: ["--test", "test/code-context.test.mjs"] },
|
|
9
|
+
{ compiler: "typescript-6", args: ["--test", "test/code-context.test.mjs"] },
|
|
10
|
+
];
|
|
11
|
+
for (const suite of suites) {
|
|
12
|
+
const result = spawnSync(process.execPath, suite.args, {
|
|
13
|
+
cwd: repoRoot,
|
|
14
|
+
stdio: "inherit",
|
|
15
|
+
env: { ...process.env, NIMICODING_LANG: "en", NO_COLOR: "1", NIMICODING_TEST_TYPESCRIPT: suite.compiler },
|
|
16
|
+
});
|
|
17
|
+
if (result.error) {
|
|
18
|
+
process.stderr.write(`node --test failed: ${result.error.message}\n`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
15
22
|
}
|
|
16
|
-
|
|
17
|
-
process.exit(result.status ?? 1);
|
package/cli/lib/code/context.mjs
CHANGED
|
@@ -8,7 +8,15 @@ import { promisify } from "node:util";
|
|
|
8
8
|
import { compareText } from "../authority/diagnostics.mjs";
|
|
9
9
|
|
|
10
10
|
const execFileAsync = promisify(execFile);
|
|
11
|
-
const
|
|
11
|
+
const TYPESCRIPT_VERSION_RANGE = ">=5.9.3 <7.0.0 (stable releases only)";
|
|
12
|
+
|
|
13
|
+
function supportedTypeScriptVersion(version) {
|
|
14
|
+
if (typeof version !== "string") return false;
|
|
15
|
+
const parts = /^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)$/u.exec(version);
|
|
16
|
+
if (parts === null) return false;
|
|
17
|
+
const [major, minor, patch] = parts.slice(1).map(Number);
|
|
18
|
+
return (major === 5 && (minor > 9 || (minor === 9 && patch >= 3))) || major === 6;
|
|
19
|
+
}
|
|
12
20
|
|
|
13
21
|
export class CodeContextFailure extends Error {
|
|
14
22
|
constructor(code, message) {
|
|
@@ -140,7 +148,7 @@ async function loadProjectTypeScript(repository, tsconfigPath) {
|
|
|
140
148
|
packagePath = requireFromOwner.resolve("typescript/package.json");
|
|
141
149
|
compiler = requireFromOwner("typescript");
|
|
142
150
|
} catch {
|
|
143
|
-
fail("CODE_TYPESCRIPT_UNSUPPORTED", "tsconfig owner cannot resolve project-local TypeScript
|
|
151
|
+
fail("CODE_TYPESCRIPT_UNSUPPORTED", "tsconfig owner cannot resolve project-local TypeScript");
|
|
144
152
|
}
|
|
145
153
|
let packageManifest;
|
|
146
154
|
try {
|
|
@@ -148,8 +156,8 @@ async function loadProjectTypeScript(repository, tsconfigPath) {
|
|
|
148
156
|
} catch {
|
|
149
157
|
fail("CODE_TYPESCRIPT_UNSUPPORTED", "project-local TypeScript package metadata is unreadable");
|
|
150
158
|
}
|
|
151
|
-
if (packageManifest.version !==
|
|
152
|
-
fail("CODE_TYPESCRIPT_UNSUPPORTED",
|
|
159
|
+
if (packageManifest.version !== compiler.version || !supportedTypeScriptVersion(compiler.version)) {
|
|
160
|
+
fail("CODE_TYPESCRIPT_UNSUPPORTED", `project-local TypeScript metadata and compiler versions must agree and satisfy ${TYPESCRIPT_VERSION_RANGE}`);
|
|
153
161
|
}
|
|
154
162
|
for (const capability of ["readConfigFile", "parseJsonConfigFileContent", "createProgram", "isIdentifier"]) {
|
|
155
163
|
if (typeof compiler[capability] !== "function") {
|
|
@@ -159,7 +167,7 @@ async function loadProjectTypeScript(repository, tsconfigPath) {
|
|
|
159
167
|
return {
|
|
160
168
|
compiler,
|
|
161
169
|
compilerRoot: await realpath(path.dirname(packagePath)),
|
|
162
|
-
compilerVersion:
|
|
170
|
+
compilerVersion: compiler.version,
|
|
163
171
|
};
|
|
164
172
|
}
|
|
165
173
|
|
|
@@ -189,7 +197,7 @@ function sourceFileForPath(compiler, program, sourcePath) {
|
|
|
189
197
|
|
|
190
198
|
function createSelectedProgram(compiler, tsconfigPath, sourcePath) {
|
|
191
199
|
const config = compiler.readConfigFile(tsconfigPath, compiler.sys.readFile);
|
|
192
|
-
if (config.error !== undefined) fail("CODE_CONFIG_INVALID", "tsconfig could not be read with TypeScript
|
|
200
|
+
if (config.error !== undefined) fail("CODE_CONFIG_INVALID", "tsconfig could not be read with the project-local TypeScript compiler");
|
|
193
201
|
const parsed = compiler.parseJsonConfigFileContent(
|
|
194
202
|
config.config,
|
|
195
203
|
compiler.sys,
|
package/methodology/core.yaml
CHANGED
|
@@ -14,7 +14,7 @@ methodology:
|
|
|
14
14
|
- bounded_explicit_relation_graph_navigation
|
|
15
15
|
- project_bound_deterministic_authority_audit_and_SARIF_projection
|
|
16
16
|
- semantic_diff_and_declared_review_obligations
|
|
17
|
-
-
|
|
17
|
+
- explicit_project_TypeScript_5_9_and_6_root_direct_bounded_code_context
|
|
18
18
|
- transient_exact_physical_code_authority_marker_lookup_and_lifecycle_audit_for_TypeScript_TSX_Go_Python_and_Rust
|
|
19
19
|
does_not_own:
|
|
20
20
|
- project_product_semantics
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimiplatform/nimi-coding",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Canonical authority products and bounded read-only code queries for AI coding systems.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,5 +65,9 @@
|
|
|
65
65
|
"check:pack": "npm pack --dry-run",
|
|
66
66
|
"prepack": "node ./cli/dev/check-authority-surface.mjs && node ./cli/dev/check-product-conformance.mjs",
|
|
67
67
|
"test": "node ./cli/dev/run-suite.mjs"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"typescript-6": "npm:typescript@6.0.3",
|
|
71
|
+
"typescript-6-0-2": "npm:typescript@6.0.2"
|
|
68
72
|
}
|
|
69
73
|
}
|
package/spec/code-context.yaml
CHANGED
|
@@ -7,7 +7,9 @@ product_claim: explicit_TypeScript_root_returns_one_bounded_root_direct_static_o
|
|
|
7
7
|
command: nimicoding code context <repo-relative-.ts-or-.tsx-path> --repo <exact-git-worktree-root> --symbol <top-level-identifier> --tsconfig <repo-relative-tsconfig> --max-bytes <integer>=512
|
|
8
8
|
compiler:
|
|
9
9
|
language: TypeScript_TSX
|
|
10
|
-
version: 5.9.3
|
|
10
|
+
version: ">=5.9.3 <7.0.0 (stable releases only)"
|
|
11
|
+
identity: package_metadata_version_equals_loaded_compiler_version
|
|
12
|
+
reported_version: actual_loaded_project_compiler_version
|
|
11
13
|
source: nearest_repo_contained_tsconfig_owner_package
|
|
12
14
|
program: fresh_complete_selected_config_without_project_references
|
|
13
15
|
root:
|
package/spec/product-scope.yaml
CHANGED
|
@@ -12,7 +12,7 @@ owned_surfaces:
|
|
|
12
12
|
- bounded_direct_references_exact_relation_paths_and_local_subgraphs
|
|
13
13
|
- project_bound_deterministic_graph_and_exact_lexical_authority_audit_and_SARIF_projection
|
|
14
14
|
- git_aware_exact_read_only_authority_change_review
|
|
15
|
-
-
|
|
15
|
+
- explicit_project_TypeScript_5_9_and_6_root_direct_bounded_code_context
|
|
16
16
|
- transient_exact_code_authority_marker_lookup_and_lifecycle_audit_for_tracked_current_TypeScript_TSX_Go_Python_and_Rust_source
|
|
17
17
|
canonical_boundary:
|
|
18
18
|
host_product_authority: .nimi/spec/**/*.authority.{yaml,md}
|