@nimiplatform/nimi-coding 0.6.3 → 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 CHANGED
@@ -2,6 +2,15 @@
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
+
10
+ ## 0.6.4
11
+
12
+ - Made experimental `code context` declaration ordering independent of the host locale, using UTF-16 code-unit text order followed by numeric source positions.
13
+
5
14
  ## 0.6.3
6
15
 
7
16
  - Removed Claude-specific managed entrypoints and path validation. `start`, `sync`, `doctor`, and `clear` now manage only `AGENTS.md` instruction blocks and leave unrelated host files untouched.
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, TypeScript 5.9.3, outbound only; no locating, inbound impact, runtime dispatch, or task-completeness claim |
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、TypeScript 5.9.3、仅 outbound;不承诺 locating、inbound impact、runtime dispatch 或 task completeness |
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
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.6.3";
1
+ export const VERSION = "0.6.5";
2
2
  export const PACKAGE_NAME = "@nimiplatform/nimi-coding";
3
3
  export const PROJECT_LOCAL_CLI_INVOCATION = "pnpm exec nimicoding";
4
4
  export const LOCAL_GITIGNORE_ENTRIES = [".nimi/local/"];
@@ -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 result = spawnSync(process.execPath, ["--test"], {
7
- cwd: repoRoot,
8
- stdio: "inherit",
9
- env: { ...process.env, NIMICODING_LANG: "en", NO_COLOR: "1" },
10
- });
11
-
12
- if (result.error) {
13
- process.stderr.write(`node --test failed: ${result.error.message}\n`);
14
- process.exit(1);
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);
@@ -5,8 +5,18 @@ import { createRequire } from "node:module";
5
5
  import path from "node:path";
6
6
  import { promisify } from "node:util";
7
7
 
8
+ import { compareText } from "../authority/diagnostics.mjs";
9
+
8
10
  const execFileAsync = promisify(execFile);
9
- const TYPESCRIPT_VERSION = "5.9.3";
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
+ }
10
20
 
11
21
  export class CodeContextFailure extends Error {
12
22
  constructor(code, message) {
@@ -138,7 +148,7 @@ async function loadProjectTypeScript(repository, tsconfigPath) {
138
148
  packagePath = requireFromOwner.resolve("typescript/package.json");
139
149
  compiler = requireFromOwner("typescript");
140
150
  } catch {
141
- fail("CODE_TYPESCRIPT_UNSUPPORTED", "tsconfig owner cannot resolve project-local TypeScript 5.9.3");
151
+ fail("CODE_TYPESCRIPT_UNSUPPORTED", "tsconfig owner cannot resolve project-local TypeScript");
142
152
  }
143
153
  let packageManifest;
144
154
  try {
@@ -146,8 +156,8 @@ async function loadProjectTypeScript(repository, tsconfigPath) {
146
156
  } catch {
147
157
  fail("CODE_TYPESCRIPT_UNSUPPORTED", "project-local TypeScript package metadata is unreadable");
148
158
  }
149
- if (packageManifest.version !== TYPESCRIPT_VERSION || compiler.version !== TYPESCRIPT_VERSION) {
150
- fail("CODE_TYPESCRIPT_UNSUPPORTED", "project-local TypeScript version must be exactly 5.9.3");
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}`);
151
161
  }
152
162
  for (const capability of ["readConfigFile", "parseJsonConfigFileContent", "createProgram", "isIdentifier"]) {
153
163
  if (typeof compiler[capability] !== "function") {
@@ -157,7 +167,7 @@ async function loadProjectTypeScript(repository, tsconfigPath) {
157
167
  return {
158
168
  compiler,
159
169
  compilerRoot: await realpath(path.dirname(packagePath)),
160
- compilerVersion: TYPESCRIPT_VERSION,
170
+ compilerVersion: compiler.version,
161
171
  };
162
172
  }
163
173
 
@@ -187,7 +197,7 @@ function sourceFileForPath(compiler, program, sourcePath) {
187
197
 
188
198
  function createSelectedProgram(compiler, tsconfigPath, sourcePath) {
189
199
  const config = compiler.readConfigFile(tsconfigPath, compiler.sys.readFile);
190
- if (config.error !== undefined) fail("CODE_CONFIG_INVALID", "tsconfig could not be read with TypeScript 5.9.3");
200
+ if (config.error !== undefined) fail("CODE_CONFIG_INVALID", "tsconfig could not be read with the project-local TypeScript compiler");
191
201
  const parsed = compiler.parseJsonConfigFileContent(
192
202
  config.config,
193
203
  compiler.sys,
@@ -339,10 +349,10 @@ function portableLocus(compiler, repository, compilerRoot, compilerVersion, node
339
349
  }
340
350
 
341
351
  function compareLoci(left, right) {
342
- return left.origin.localeCompare(right.origin)
343
- || (left.package?.name ?? "").localeCompare(right.package?.name ?? "")
344
- || (left.package?.version ?? "").localeCompare(right.package?.version ?? "")
345
- || left.path.localeCompare(right.path)
352
+ return compareText(left.origin, right.origin)
353
+ || compareText(left.package?.name ?? "", right.package?.name ?? "")
354
+ || compareText(left.package?.version ?? "", right.package?.version ?? "")
355
+ || compareText(left.path, right.path)
346
356
  || left.range.start_line - right.range.start_line
347
357
  || left.range.start_column - right.range.start_column
348
358
  || left.range.end_line - right.range.end_line
@@ -437,7 +447,7 @@ function collectSites(compiler, rootNode) {
437
447
  return sites.sort((left, right) => (
438
448
  left.node.getStart() - right.node.getStart()
439
449
  || left.node.getEnd() - right.node.getEnd()
440
- || left.role.localeCompare(right.role)
450
+ || compareText(left.role, right.role)
441
451
  ));
442
452
  }
443
453
 
@@ -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
- - explicit_TypeScript_5_9_3_root_direct_bounded_code_context
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",
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
  }
@@ -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:
@@ -18,6 +20,7 @@ projection:
18
20
  scope: selected_root_AST_only
19
21
  relations: [static_value_binding, static_type_binding, static_constructor_binding, static_JSX_binding]
20
22
  target: complete_nonempty_portable_declaration_set
23
+ declaration_loci_order: origin_package_name_package_version_path_by_UTF_16_code_units_then_numeric_range
21
24
  target_source: optional_single_repository_declaration_syntactic_slice
22
25
  runtime_dispatch: not_evaluated
23
26
  response:
@@ -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
- - explicit_TypeScript_5_9_3_root_direct_bounded_code_context
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}