@nimiplatform/nimi-coding 0.6.1 → 0.6.2
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 +6 -0
- package/README.md +4 -0
- package/README.zh-CN.md +4 -0
- package/cli/constants.mjs +1 -1
- package/cli/lib/code/context.mjs +3 -1
- package/cli/lib/entrypoints.mjs +4 -3
- package/methodology/authority-authoring.yaml +7 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.6.2
|
|
6
|
+
|
|
7
|
+
- Made managed authority/code queries depend on task-relevant uncertainty, including static-dependency questions for `code context`, while preserving authority admission and result boundaries.
|
|
8
|
+
- Scoped failed or incomplete query handling to dependent decisions, allowing independent authorized work to continue without treating diagnostics, hypotheses, or partial output as complete authority context.
|
|
9
|
+
- Fixed a `code context` crash on local export aliases without a module specifier; affected sites retain the existing explicit `unresolved` result instead of inventing a dependency.
|
|
10
|
+
|
|
5
11
|
## 0.6.1
|
|
6
12
|
|
|
7
13
|
- Extended experimental `nimicoding code authority` marker lookup and lifecycle audit to tracked current Python and Rust source while keeping `code context` TypeScript/TSX-only.
|
package/README.md
CHANGED
|
@@ -73,6 +73,8 @@ The current Nimi-realm validation corpus contains 33 canonical containers, 2,212
|
|
|
73
73
|
|
|
74
74
|
This is instruction-based integration, not an automatic execution layer. Nimi Coding installs no hook or daemon, intercepts no task, requires no fixed preflight, and owns no task or completion state. The host decides whether a query is useful for the current coding task. `code authority` only recalls explicit markers and current authority lifecycle; `code context` only returns the admitted root-direct TypeScript projection. Neither result proves conformance, replaces affected builds and tests, or evaluates unannotated code.
|
|
75
75
|
|
|
76
|
+
Use queries to resolve uncertainties that affect the task, and reuse sufficient current evidence. Selecting a TS/TSX consumer alone does not require `code context`; an unresolved static-dependency question does. A failed invocation supplies no usable result. Pause decisions that require refused, missing, or incomplete results while continuing independent authorized work. Diagnostics guide repair, and partial output never establishes complete context. Query boundaries do not limit host reasoning, but hypotheses must remain distinct from project authority.
|
|
77
|
+
|
|
76
78
|
## Five-minute adoption path
|
|
77
79
|
|
|
78
80
|
Install and initialize the package:
|
|
@@ -323,6 +325,8 @@ nimicoding code context <repo-relative-.ts-or-.tsx-path> --repo <exact-git-workt
|
|
|
323
325
|
|
|
324
326
|
The command reads the current filesystem and writes one compact JSON response to stdout. `completed` covers only its closed root-direct static-binding policy. `partial` reports the first output-budget frontier; `refused` contains no usable context product. The command neither edits the repository nor selects, runs, or records verification.
|
|
325
327
|
|
|
328
|
+
`completed` can include explicitly unresolved sites. In particular, an alias chain through a local export without a module specifier is reported as `unresolved` with reason `alias_resolution_not_unique`; it is not a proven dependency.
|
|
329
|
+
|
|
326
330
|
</details>
|
|
327
331
|
|
|
328
332
|
Relation types are a non-empty unique subset of the closed set `applies_to,supersedes`; discovery relation preview requires direction, relation types, and edge budget together.
|
package/README.zh-CN.md
CHANGED
|
@@ -73,6 +73,8 @@ AI host · 第三方扩展 · CI · future editor/UI surfaces
|
|
|
73
73
|
|
|
74
74
|
这是一种基于 instruction 的集成,不是自动执行层。Nimi Coding 不安装 hook 或 daemon,不拦截 task,不要求固定 preflight,也不拥有 task 或 completion state。是否需要查询由 host 根据当前 coding task 决定。`code authority` 只召回显式 marker 和当前 authority lifecycle;`code context` 只返回 admitted root-direct TypeScript projection。两者都不证明 conformance,不替代 affected build/tests,也不评价未标注代码。
|
|
75
75
|
|
|
76
|
+
查询用于解决会影响当前任务的不确定性,已有依据充分时直接复用。选定 TS/TSX consumer 本身不要求调用 `code context`;仍有静态依赖疑问时才使用。失败的调用不提供可用结果;暂停依赖被拒绝、缺失或不完整结果的判断,同时继续独立且已授权的工作。诊断用于修复,局部输出不能证明上下文完整。查询边界不限制 host 的推理,但假设必须与项目 authority 区分。
|
|
77
|
+
|
|
76
78
|
## 五分钟接入
|
|
77
79
|
|
|
78
80
|
安装并初始化:
|
|
@@ -323,6 +325,8 @@ nimicoding code context <repo-relative-.ts-or-.tsx-path> --repo <exact-git-workt
|
|
|
323
325
|
|
|
324
326
|
该命令读取当前文件系统,并向 stdout 写入一个 compact JSON response。`completed` 只覆盖封闭的 root-direct static-binding policy;`partial` 返回首个 output-budget frontier;`refused` 不包含可用 context product。命令不会编辑 repository,也不会选择、运行或保存 verification。
|
|
325
327
|
|
|
328
|
+
`completed` 可以包含明确未解析的 site。特别是经过无 module specifier 的本地 export 的 alias chain,会返回 `unresolved` 和既有原因 `alias_resolution_not_unique`;该 site 不是已证明的依赖。
|
|
329
|
+
|
|
326
330
|
</details>
|
|
327
331
|
|
|
328
332
|
Relation types 是 closed set `applies_to,supersedes` 的非空、无重复 subset;discovery relation preview 必须同时提供 direction、relation types 和 edge budget。
|
package/cli/constants.mjs
CHANGED
package/cli/lib/code/context.mjs
CHANGED
|
@@ -479,7 +479,9 @@ function moduleSpecifierForAlias(compiler, declaration) {
|
|
|
479
479
|
let current = declaration;
|
|
480
480
|
while (current !== undefined) {
|
|
481
481
|
if (compiler.isImportDeclaration(current) || compiler.isExportDeclaration(current)) {
|
|
482
|
-
return compiler.isStringLiteral(current.moduleSpecifier)
|
|
482
|
+
return current.moduleSpecifier !== undefined && compiler.isStringLiteral(current.moduleSpecifier)
|
|
483
|
+
? current.moduleSpecifier.text
|
|
484
|
+
: null;
|
|
483
485
|
}
|
|
484
486
|
if (compiler.isImportEqualsDeclaration(current)) {
|
|
485
487
|
const reference = current.moduleReference;
|
package/cli/lib/entrypoints.mjs
CHANGED
|
@@ -21,18 +21,19 @@ function authorityAuthoringLines() {
|
|
|
21
21
|
return [
|
|
22
22
|
`- From the repository root, invoke the pinned project-local CLI as \`${PROJECT_LOCAL_CLI_INVOCATION}\`; do not probe or rely on a global \`nimicoding\` binary in \`PATH\`.`,
|
|
23
23
|
"- Product authority lives under `.nimi/spec/**`.",
|
|
24
|
+
"- Choose authority and code queries when their declared scope can resolve an uncertainty that affects the current task; reuse sufficient current evidence. Query scope is not the limit of host reasoning or authorized work, and hypotheses are not product authority.",
|
|
24
25
|
"- For canonical authority authoring, read only `.nimi/methodology/authority-authoring.yaml`, the affected authority files or bounded task context, and CLI diagnostics.",
|
|
25
26
|
`- Use \`${PROJECT_LOCAL_CLI_INVOCATION} authority context <path> <id> --max-units <n> --max-bytes <n> --json\` only for the complete declared outgoing interpretation closure; it is not complete task context, and failure never permits guessed or partial context.`,
|
|
26
27
|
`- Use \`${PROJECT_LOCAL_CLI_INVOCATION} authority diff\` and \`${PROJECT_LOCAL_CLI_INVOCATION} authority impact\` with explicit \`--max-bytes\`; impact reports declared review obligations and does not prove implementation, consumers, or tests are synchronized.`,
|
|
27
28
|
`- Use \`${PROJECT_LOCAL_CLI_INVOCATION} authority change-candidates\` only with explicit channels and budgets; its complete union is recall input, never conflict, retirement, absence, authority, or conformance judgment.`,
|
|
28
|
-
`-
|
|
29
|
+
`- When explicit authority links are needed, use \`${PROJECT_LOCAL_CLI_INVOCATION} code authority --repo <root> --authority <id> --max-files <n> --max-bytes <n>\` to locate annotated code, and use \`--source <path>\` for code-to-authority lookup. Results cover only explicit markers and authority lifecycle; they do not prove implementation conformance or evaluate unannotated code.`,
|
|
29
30
|
`- For a new or changed authority-governed feature, add the reserved standalone physical line \`// @nimi-authority: <exact-id>\` in TypeScript/TSX, Go, or Rust, and \`# @nimi-authority: <exact-id>\` in Python. The scanner does not prove language comment context, so use this reserved form only for intentional links at a few key semantic owners.`,
|
|
30
31
|
`- Use \`// @nimi-deprecated: <exact-id>\`, or \`# @nimi-deprecated: <exact-id>\` in Python, only after direct authority evidence or a real product failure confirms obsolete semantics; find it with \`${PROJECT_LOCAL_CLI_INVOCATION} code authority --repo <root> --audit --max-files <n> --max-bytes <n>\` and remove it with the hard cut.`,
|
|
31
|
-
`-
|
|
32
|
+
`- When a selected TypeScript or TSX consumer still has a static-dependency question, use \`${PROJECT_LOCAL_CLI_INVOCATION} code context <path> --repo <root> --symbol <identifier> --tsconfig <path> --max-bytes <n>\` for bounded root-direct static dependencies; it is not inbound impact, runtime dispatch, or complete task context.`,
|
|
32
33
|
`- Use \`${PROJECT_LOCAL_CLI_INVOCATION} sync --check\` to diagnose drift in package-owned managed projections, \`${PROJECT_LOCAL_CLI_INVOCATION} sync --apply\` to restore them, and \`${PROJECT_LOCAL_CLI_INVOCATION} doctor\` to diagnose package/managed compatibility. These commands do not validate product authority, implementation conformance, or task readiness.`,
|
|
33
34
|
"- Under `.nimi/spec/**`, author only closed multi-unit `*.authority.yaml` containers or single-unit `*.authority.md`; historical document formats are unsupported and never inferred.",
|
|
34
35
|
`- Run \`${PROJECT_LOCAL_CLI_INVOCATION} authority fmt\` on each changed file, then \`${PROJECT_LOCAL_CLI_INVOCATION} authority check\` on the complete authority input set.`,
|
|
35
|
-
`- A failed project-local \`${PROJECT_LOCAL_CLI_INVOCATION} ...\` invocation
|
|
36
|
+
`- A failed project-local \`${PROJECT_LOCAL_CLI_INVOCATION} ...\` invocation supplies no usable result. Pause decisions that require refused, missing, or incomplete results; continue independent authorized work. Never substitute guessed, corpus-wide, or fallback context, or treat diagnostics or partial output as complete context; choose repair values only from product/task authority.`,
|
|
36
37
|
"- Keep derived and local verification output under `.nimi/local/**`; it is never product authority.",
|
|
37
38
|
];
|
|
38
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
version:
|
|
1
|
+
version: 8
|
|
2
2
|
id: nimicoding.authority-authoring
|
|
3
3
|
purpose: Author explicit authority and navigate current implementation without inference.
|
|
4
4
|
authority_boundary:
|
|
@@ -11,18 +11,18 @@ authority_boundary:
|
|
|
11
11
|
cli_execution:
|
|
12
12
|
cwd: repository_root
|
|
13
13
|
command_prefix: pnpm exec nimicoding
|
|
14
|
-
rule:
|
|
14
|
+
rule: Use the pinned local package, never global PATH. Refused, missing or partial results block dependent decisions, not independent authorized work. No guessed/corpus-wide/fallback context; repair only from task/product authority.
|
|
15
15
|
|
|
16
16
|
daily_workflow:
|
|
17
|
-
-
|
|
17
|
+
- For needed authority selection without an ID, use pnpm exec nimicoding authority discover <path> <query> --max-candidates 10 --max-snippet-terms 24 --max-bytes 131072 --json. Candidates never prove selection or absence.
|
|
18
18
|
- Select IDs only from task/product authority. pnpm exec nimicoding authority query <path> <id> --max-bytes <n> --json returns one unit; pnpm exec nimicoding authority context <path> <id> --max-units <n> --max-bytes <n> --json returns its outgoing applies_to/supersedes closure, not task context.
|
|
19
19
|
- Modify only project authority; never infer product values or relations.
|
|
20
20
|
- Run pnpm exec nimicoding authority fmt <changed-file> for each changed file.
|
|
21
21
|
- Run pnpm exec nimicoding authority check <complete-path> [--scope-bindings <file>] --json, then pnpm exec nimicoding authority compile <complete-path> --json. For anchors run pnpm exec nimicoding authority anchors <repo> --spec <corpus> [--scope-bindings <file>] --max-units <n> --max-anchors <n> --max-bytes <n> --json.
|
|
22
22
|
- For semantic changes, run complete-input diff and impact with budgets; obligations are host follow-up targets, not results.
|
|
23
|
-
- Never continue from diagnostics, unknown IDs, budget failures, or guessed/partial results.
|
|
24
23
|
|
|
25
24
|
implementation_navigation:
|
|
25
|
+
query_use: Query for unresolved task questions; reuse sufficient current evidence. Use code context for remaining TS/TSX static-dependency questions. Hypotheses are not authority.
|
|
26
26
|
authority_to_code: pnpm exec nimicoding code authority --repo <root> --authority <exact-id> --max-files <n> --max-bytes <n>
|
|
27
27
|
code_to_authority: pnpm exec nimicoding code authority --repo <root> --source <tracked-path> --max-files <n> --max-bytes <n>
|
|
28
28
|
context: pnpm exec nimicoding code context <ts-or-tsx-path> --repo <root> --symbol <top-level-identifier> --tsconfig <path> --max-bytes <n>
|
|
@@ -32,14 +32,14 @@ implementation_navigation:
|
|
|
32
32
|
deprecated_slash: "// @nimi-deprecated: <same-exact-id>"
|
|
33
33
|
authority_python: "# @nimi-authority: <exact-id>"
|
|
34
34
|
deprecated_python: "# @nimi-deprecated: <same-exact-id>"
|
|
35
|
-
rule: Optional markers are reserved standalone physical lines
|
|
35
|
+
rule: Optional markers are reserved standalone physical lines at key semantic owners; comment context is not proved. Deprecation needs authority/product failure evidence; remove with hard cut.
|
|
36
36
|
boundary: Marker lines return locations/lifecycle; TypeScript context is root-direct static outbound only. Neither evaluates unannotated code, conformance, inbound impact, runtime dispatch, or completion.
|
|
37
37
|
|
|
38
38
|
managed_surfaces:
|
|
39
39
|
check: pnpm exec nimicoding sync --check
|
|
40
40
|
restore: pnpm exec nimicoding sync --apply
|
|
41
41
|
doctor: pnpm exec nimicoding doctor
|
|
42
|
-
boundary: Sync
|
|
42
|
+
boundary: Sync checks/restores owned projections; doctor checks compatibility. Neither validates authority, code, or task readiness.
|
|
43
43
|
|
|
44
44
|
source_profiles:
|
|
45
45
|
yaml:
|
|
@@ -89,7 +89,6 @@ formatter_and_diagnostics:
|
|
|
89
89
|
- fmt canonicalizes v2 and strips redundant unit defaults.
|
|
90
90
|
- Non-v2 input fails fmt/check/compile/diff/impact/review.
|
|
91
91
|
- check/compile use complete paths and emit no public/partial AuthorityIR.
|
|
92
|
-
- Diagnostics give locations and repair categories, never product values.
|
|
93
92
|
|
|
94
93
|
change_workflow:
|
|
95
94
|
diff: pnpm exec nimicoding authority diff <before-path> <after-path> --max-bytes <positive-integer> --json
|
|
@@ -142,4 +141,4 @@ canonical_examples:
|
|
|
142
141
|
target: rule.checkout-no-anonymous-v0
|
|
143
142
|
|
|
144
143
|
final_boundaries:
|
|
145
|
-
-
|
|
144
|
+
- Derived/local output is never authority.
|