@nimiplatform/nimi-coding 0.6.0 → 0.6.1
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/CONTRIBUTING.md +2 -0
- package/README.md +9 -7
- package/README.zh-CN.md +9 -7
- package/cli/commands/code.mjs +1 -1
- package/cli/constants.mjs +1 -1
- package/cli/lib/code/authority-annotation-scan.mjs +28 -75
- package/cli/lib/code/authority-annotations.mjs +3 -3
- package/cli/lib/entrypoints.mjs +2 -2
- package/methodology/authority-authoring.yaml +8 -5
- package/methodology/core.yaml +3 -2
- package/package.json +2 -2
- package/spec/code-authority-annotations.yaml +10 -5
- package/spec/product-scope.yaml +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.6.1
|
|
6
|
+
|
|
7
|
+
- Extended experimental `nimicoding code authority` marker lookup and lifecycle audit to tracked current Python and Rust source while keeping `code context` TypeScript/TSX-only.
|
|
8
|
+
- Shipped a breaking fix to the experimental marker spelling: the reserved standalone `@nimi-authority` / `@nimi-deprecated` physical-line protocol replaces the 0.6.0 spelling without compatibility, and exact matching physical lines are intentional markers regardless of lexical context. Language comment parsing was removed.
|
|
9
|
+
|
|
5
10
|
## 0.6.0
|
|
6
11
|
|
|
7
12
|
- Made all AI-visible operational guidance resolve the pinned project-local CLI through repository-root `pnpm exec nimicoding`, removing the false global-`PATH` availability assumption.
|
package/CONTRIBUTING.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Nimi Coding accepts changes to canonical-authority products, formatter/compiler primitives, exact managed projections, and bounded read-only code queries over explicit inputs or markers. Historical-format reconstruction, product-semantic generation, AI-host control, provider execution, task-state management, and review-state management are outside this package. Code queries remain request-local and do not establish implementation conformance.
|
|
4
4
|
|
|
5
|
+
`code authority` uses reserved standalone `// @nimi-*` physical lines in TypeScript/TSX, Go, and Rust, and `# @nimi-*` lines in Python; it does not prove language comment context, so an exact line in a multiline literal is also a marker. `code context` remains TypeScript/TSX-only.
|
|
6
|
+
|
|
5
7
|
Before opening a change:
|
|
6
8
|
|
|
7
9
|
```bash
|
package/README.md
CHANGED
|
@@ -63,13 +63,13 @@ Projects own all product meaning. Nimi Coding admits, locates, relates, and deri
|
|
|
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
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 |
|
|
66
|
-
| Explicit code-authority links | Transient Authority→Code, Code→Authority, and lifecycle audit over optional exact markers in tracked current `.ts`, `.tsx`, and `.
|
|
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.
|
|
69
69
|
|
|
70
|
-
## Using the
|
|
70
|
+
## Using the code surface
|
|
71
71
|
|
|
72
|
-
`start` writes package-managed guidance into the marked blocks in `AGENTS.md` and `CLAUDE.md`. On an existing installation, `doctor` diagnoses drift in that guidance and the compact methodology projection; `sync --apply` restores the exact current package projections while preserving host-owned text outside the managed blocks. An AI host that honors repository instructions can therefore learn when to request `code authority` or `code context`, and when a changed authority-governed feature warrants a small number of
|
|
72
|
+
`start` writes package-managed guidance into the marked blocks in `AGENTS.md` and `CLAUDE.md`. On an existing installation, `doctor` diagnoses drift in that guidance and the compact methodology projection; `sync --apply` restores the exact current package projections while preserving host-owned text outside the managed blocks. An AI host that honors repository instructions can therefore learn when to request `code authority` or `code context`, and when a changed authority-governed feature warrants a small number of `@nimi-authority` markers at key semantic owners.
|
|
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
|
|
|
@@ -302,13 +302,15 @@ nimicoding authority review <repository-path> --base <git-ref> --bindings <file>
|
|
|
302
302
|
<summary>Explicit code-authority marker syntax</summary>
|
|
303
303
|
|
|
304
304
|
```text
|
|
305
|
-
// nimi-authority: <exact-authority-id>
|
|
306
|
-
// nimi-deprecated: <exact-authority-id>
|
|
305
|
+
// @nimi-authority: <exact-authority-id>
|
|
306
|
+
// @nimi-deprecated: <exact-authority-id>
|
|
307
|
+
# @nimi-authority: <exact-authority-id>
|
|
308
|
+
# @nimi-deprecated: <exact-authority-id>
|
|
307
309
|
|
|
308
|
-
nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-or-.
|
|
310
|
+
nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-.go-.py-or-.rs-path>|--audit) --max-files <integer> --max-bytes <integer>=512
|
|
309
311
|
```
|
|
310
312
|
|
|
311
|
-
Markers are optional exact
|
|
313
|
+
Markers are optional reserved physical lines. TypeScript/TSX, Go, and Rust use `//`; Python uses `#`. The scanner recognizes the exact standalone `@nimi-*` form without parsing or proving the host language's comment context; an exact matching line inside a multiline literal is therefore also a marker. Keep this reserved form out of examples and source data unless the link is intentional. The command compiles the repository's complete canonical `.nimi/spec`, scans the selected Git-tracked current-filesystem source scope once, and returns one complete compact JSON result or refuses. `@nimi-deprecated` records an explicit developer judgment and is reported by the audit; the tool does not infer that judgment or prove marker pairing, declaration ownership, conformance, or hard-cut completion. Unannotated code remains valid and `not_evaluated`. No index, cache, scope binding, report, or task state is written.
|
|
312
314
|
|
|
313
315
|
</details>
|
|
314
316
|
|
package/README.zh-CN.md
CHANGED
|
@@ -63,13 +63,13 @@ AI host · 第三方扩展 · CI · future editor/UI surfaces
|
|
|
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
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 |
|
|
66
|
-
| 显式 code-authority 链接 | 对 Git tracked 当前 `.ts`、`.tsx`、`.go` 源码中的可选 exact marker 提供 transient Authority→Code、Code→Authority 和 lifecycle audit | 只声明 marker location;不声明 declaration ownership、annotation coverage、implementation conformance 或未标注 legacy detection |
|
|
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 已覆盖所有领域。
|
|
69
69
|
|
|
70
|
-
## 使用
|
|
70
|
+
## 使用 code surface
|
|
71
71
|
|
|
72
|
-
`start` 会把 package 管理的指导写入 `AGENTS.md` 和 `CLAUDE.md` 的 marked blocks。对于已有安装,`doctor` 会诊断这些指导及 compact methodology projection 的 drift,`sync --apply` 则恢复当前 package 的精确 projections,同时保留 managed blocks 之外的宿主文本。因此,遵守 repository instructions 的 AI host 可以知道何时按需调用 `code authority` 或 `code context`,以及何时只在发生变更、受 authority 约束的功能中,为少数关键语义 owner 添加
|
|
72
|
+
`start` 会把 package 管理的指导写入 `AGENTS.md` 和 `CLAUDE.md` 的 marked blocks。对于已有安装,`doctor` 会诊断这些指导及 compact methodology projection 的 drift,`sync --apply` 则恢复当前 package 的精确 projections,同时保留 managed blocks 之外的宿主文本。因此,遵守 repository instructions 的 AI host 可以知道何时按需调用 `code authority` 或 `code context`,以及何时只在发生变更、受 authority 约束的功能中,为少数关键语义 owner 添加 `@nimi-authority` marker。
|
|
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
|
|
|
@@ -302,13 +302,15 @@ nimicoding authority review <repository-path> --base <git-ref> --bindings <file>
|
|
|
302
302
|
<summary>显式 code-authority marker syntax</summary>
|
|
303
303
|
|
|
304
304
|
```text
|
|
305
|
-
// nimi-authority: <exact-authority-id>
|
|
306
|
-
// nimi-deprecated: <exact-authority-id>
|
|
305
|
+
// @nimi-authority: <exact-authority-id>
|
|
306
|
+
// @nimi-deprecated: <exact-authority-id>
|
|
307
|
+
# @nimi-authority: <exact-authority-id>
|
|
308
|
+
# @nimi-deprecated: <exact-authority-id>
|
|
307
309
|
|
|
308
|
-
nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-or-.
|
|
310
|
+
nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-.go-.py-or-.rs-path>|--audit) --max-files <integer> --max-bytes <integer>=512
|
|
309
311
|
```
|
|
310
312
|
|
|
311
|
-
Marker
|
|
313
|
+
Marker 是可选的保留物理行。TypeScript/TSX、Go、Rust 使用 `//`,Python 使用 `#`。扫描器只识别独占一行的 exact `@nimi-*` 格式,不解析或证明它在宿主语言中确实属于注释;因此,多行字符串中完全匹配的物理行也会被当作 marker。除非确实要建立链接,不要在示例或源码数据中使用该保留格式。命令编译 repository 的完整 canonical `.nimi/spec`,一次扫描所选 Git tracked 当前文件系统源码范围,并返回一个完整 compact JSON result,否则拒绝。`@nimi-deprecated` 记录开发者的显式判断并由 audit 报告;工具不推断该判断,也不证明 marker pairing、declaration ownership、conformance 或 hard-cut completion。未标注代码仍然合法并保持 `not_evaluated`。命令不写入 index、cache、scope binding、report 或 task state。
|
|
312
314
|
|
|
313
315
|
</details>
|
|
314
316
|
|
package/cli/commands/code.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "../lib/code/response.mjs";
|
|
17
17
|
|
|
18
18
|
export const CODE_CONTEXT_USAGE = "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";
|
|
19
|
-
export const CODE_AUTHORITY_USAGE = "nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-or-.
|
|
19
|
+
export const CODE_AUTHORITY_USAGE = "nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-.go-.py-or-.rs-path>|--audit) --max-files <integer> --max-bytes <integer>=512";
|
|
20
20
|
export const CODE_COMMAND_USAGE = [CODE_CONTEXT_USAGE, CODE_AUTHORITY_USAGE];
|
|
21
21
|
|
|
22
22
|
const GLOBAL_FLAG_OPTIONS = new Set(["--color", "--no-color"]);
|
package/cli/constants.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
|
|
3
|
-
import ts from "typescript";
|
|
4
|
-
|
|
5
3
|
import { compareText, createLocator } from "../authority/diagnostics.mjs";
|
|
6
4
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const SLASH_MARKER = {
|
|
6
|
+
exact: /^\/\/ @nimi-(authority|deprecated): ([^\s]+)$/u,
|
|
7
|
+
candidate: /^\/\/[ \t]*@nimi-(?:authority|deprecated)\b/u,
|
|
8
|
+
};
|
|
9
|
+
const HASH_MARKER = {
|
|
10
|
+
exact: /^# @nimi-(authority|deprecated): ([^\s]+)$/u,
|
|
11
|
+
candidate: /^#[ \t]*@nimi-(?:authority|deprecated)\b/u,
|
|
12
|
+
};
|
|
10
13
|
const NEARBY_SOURCE_BYTES = 512;
|
|
11
14
|
|
|
12
15
|
function comparePosition(left, right) {
|
|
@@ -37,13 +40,10 @@ function nearbySource(path, text, locator, markerEnd) {
|
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
if (text.slice(lineStart, start).trim().length > 0) return { occurrence: null, finding: null };
|
|
43
|
-
const raw = text.slice(start, end).replace(/\r$/u, "");
|
|
44
|
-
if (!MARKER_CANDIDATE.test(raw)) return { occurrence: null, finding: null };
|
|
43
|
+
function parseMarkerLine(path, text, locator, start, end, identifier, grammar) {
|
|
44
|
+
const raw = text.slice(start, end);
|
|
45
45
|
const location = { path, range: locator.range(start, end) };
|
|
46
|
-
const match =
|
|
46
|
+
const match = grammar.exact.exec(raw);
|
|
47
47
|
if (match === null || !identifier.test(match[2])) {
|
|
48
48
|
return {
|
|
49
49
|
occurrence: null,
|
|
@@ -67,78 +67,31 @@ function parseComment(path, text, locator, start, end, identifier) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
const pending = [sourceFile];
|
|
83
|
-
while (pending.length > 0) {
|
|
84
|
-
const node = pending.pop();
|
|
85
|
-
if (ts.isJsxText(node)) jsxTextRanges.push({ start: node.pos, end: node.end });
|
|
86
|
-
add(ts.getLeadingCommentRanges(text, node.pos));
|
|
87
|
-
add(ts.getTrailingCommentRanges(text, node.end));
|
|
88
|
-
pending.push(...node.getChildren(sourceFile));
|
|
89
|
-
}
|
|
90
|
-
return [...comments.values()]
|
|
91
|
-
.filter((comment) => !jsxTextRanges.some((range) => comment.start >= range.start && comment.end <= range.end))
|
|
92
|
-
.sort((left, right) => left.start - right.start || left.end - right.end);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function goLineComments(text) {
|
|
96
|
-
const comments = [];
|
|
97
|
-
let index = 0;
|
|
98
|
-
while (index < text.length) {
|
|
99
|
-
const character = text[index];
|
|
100
|
-
if (character === "/" && text[index + 1] === "/") {
|
|
101
|
-
const start = index;
|
|
102
|
-
index += 2;
|
|
103
|
-
while (index < text.length && text[index] !== "\n") index += 1;
|
|
104
|
-
comments.push({ start, end: index });
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (character === "/" && text[index + 1] === "*") {
|
|
108
|
-
const close = text.indexOf("*/", index + 2);
|
|
109
|
-
index = close < 0 ? text.length : close + 2;
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (character === "`" || character === "\"" || character === "'") {
|
|
113
|
-
const quote = character;
|
|
114
|
-
index += 1;
|
|
115
|
-
while (index < text.length) {
|
|
116
|
-
if (quote !== "`" && text[index] === "\\") {
|
|
117
|
-
index += Math.min(2, text.length - index);
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
if (text[index] === quote) {
|
|
121
|
-
index += 1;
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
index += 1;
|
|
125
|
-
}
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
index += 1;
|
|
70
|
+
function physicalMarkerLines(text, grammar) {
|
|
71
|
+
const markers = [];
|
|
72
|
+
let lineStart = 0;
|
|
73
|
+
while (lineStart < text.length) {
|
|
74
|
+
const newline = text.indexOf("\n", lineStart);
|
|
75
|
+
const lineEnd = newline < 0 ? text.length : newline;
|
|
76
|
+
const contentEnd = lineEnd > lineStart && text[lineEnd - 1] === "\r" ? lineEnd - 1 : lineEnd;
|
|
77
|
+
let start = lineStart;
|
|
78
|
+
while (start < contentEnd && (text[start] === " " || text[start] === "\t")) start += 1;
|
|
79
|
+
if (grammar.candidate.test(text.slice(start, contentEnd))) markers.push({ start, end: contentEnd });
|
|
80
|
+
lineStart = newline < 0 ? text.length : newline + 1;
|
|
129
81
|
}
|
|
130
|
-
return
|
|
82
|
+
return markers;
|
|
131
83
|
}
|
|
132
84
|
|
|
133
85
|
export function scanAuthorityAnnotations(path, text, identifierPattern) {
|
|
134
|
-
|
|
86
|
+
const grammar = path.endsWith(".py") ? HASH_MARKER : SLASH_MARKER;
|
|
87
|
+
if (!text.includes("@nimi-")) return { occurrences: [], findings: [] };
|
|
135
88
|
const locator = createLocator(text);
|
|
136
89
|
const identifier = new RegExp(identifierPattern, "u");
|
|
137
|
-
const
|
|
90
|
+
const markerLines = physicalMarkerLines(text, grammar);
|
|
138
91
|
const occurrences = [];
|
|
139
92
|
const findings = [];
|
|
140
|
-
for (const
|
|
141
|
-
const parsed =
|
|
93
|
+
for (const markerLine of markerLines) {
|
|
94
|
+
const parsed = parseMarkerLine(path, text, locator, markerLine.start, markerLine.end, identifier, grammar);
|
|
142
95
|
if (parsed.occurrence !== null) occurrences.push(parsed.occurrence);
|
|
143
96
|
if (parsed.finding !== null) findings.push(parsed.finding);
|
|
144
97
|
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
scanAuthorityAnnotations,
|
|
15
15
|
} from "./authority-annotation-scan.mjs";
|
|
16
16
|
|
|
17
|
-
const SUPPORTED_SOURCE = /(?:\.d)?\.tsx?$|\.go$/u;
|
|
17
|
+
const SUPPORTED_SOURCE = /(?:\.d)?\.tsx?$|\.go$|\.py$|\.rs$/u;
|
|
18
18
|
const UTF8 = new TextDecoder("utf-8", { fatal: true });
|
|
19
19
|
const CLASSIFICATION_ORDER = new Map([
|
|
20
20
|
["active-reference", 0],
|
|
@@ -214,7 +214,7 @@ export async function queryCodeAuthority({ repository: repositoryPath, selector,
|
|
|
214
214
|
if (selector.kind === "source") {
|
|
215
215
|
const normalized = normalizeSourceSelector(selector.path);
|
|
216
216
|
if (normalized === null || !SUPPORTED_SOURCE.test(normalized) || !tracked.has(normalized) || gitlinks.has(normalized)) {
|
|
217
|
-
fail("CODE_AUTHORITY_SOURCE_INVALID", "source selector must name one tracked .ts, .tsx, or .
|
|
217
|
+
fail("CODE_AUTHORITY_SOURCE_INVALID", "source selector must name one tracked .ts, .tsx, .go, .py, or .rs file");
|
|
218
218
|
}
|
|
219
219
|
sourcePaths = [normalized];
|
|
220
220
|
} else {
|
|
@@ -279,7 +279,7 @@ export async function queryCodeAuthority({ repository: repositoryPath, selector,
|
|
|
279
279
|
}
|
|
280
280
|
return {
|
|
281
281
|
operation: "lifecycle-audit",
|
|
282
|
-
scope: { repository: ".", source_languages: ["go", "typescript", "tsx"] },
|
|
282
|
+
scope: { repository: ".", source_languages: ["go", "python", "rust", "typescript", "tsx"] },
|
|
283
283
|
result: {
|
|
284
284
|
conclusion: findings.length === 0
|
|
285
285
|
? "annotated implementation surface has no deterministic authority lifecycle residue"
|
package/cli/lib/entrypoints.mjs
CHANGED
|
@@ -26,8 +26,8 @@ function authorityAuthoringLines() {
|
|
|
26
26
|
`- 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
27
|
`- 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
28
|
`- For implementation audits with an exact authority ID, 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
|
-
`- For a new or changed authority-governed feature, add \`// nimi-authority: <exact-id>\`
|
|
30
|
-
`- Use \`// nimi-deprecated: <exact-id>\` 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
|
|
29
|
+
`- 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
|
+
`- 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
31
|
`- After selecting an explicit TypeScript or TSX consumer, 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
32
|
`- 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
33
|
"- Under `.nimi/spec/**`, author only closed multi-unit `*.authority.yaml` containers or single-unit `*.authority.md`; historical document formats are unsupported and never inferred.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
version:
|
|
1
|
+
version: 7
|
|
2
2
|
id: nimicoding.authority-authoring
|
|
3
3
|
purpose: Author explicit authority and navigate current implementation without inference.
|
|
4
4
|
authority_boundary:
|
|
@@ -26,11 +26,14 @@ implementation_navigation:
|
|
|
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>
|
|
29
|
+
languages: {slash: [TypeScript, TSX, Go, Rust], hash: [Python], context: [TypeScript, TSX]}
|
|
29
30
|
markers:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
authority_slash: "// @nimi-authority: <exact-id>"
|
|
32
|
+
deprecated_slash: "// @nimi-deprecated: <same-exact-id>"
|
|
33
|
+
authority_python: "# @nimi-authority: <exact-id>"
|
|
34
|
+
deprecated_python: "# @nimi-deprecated: <same-exact-id>"
|
|
35
|
+
rule: Optional markers are reserved standalone physical lines near key semantic owners; comment context is not proved. Deprecated requires direct authority/product failure and is removed with hard cut.
|
|
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.
|
|
34
37
|
|
|
35
38
|
managed_surfaces:
|
|
36
39
|
check: pnpm exec nimicoding sync --check
|
package/methodology/core.yaml
CHANGED
|
@@ -15,7 +15,7 @@ methodology:
|
|
|
15
15
|
- project_bound_deterministic_authority_audit_and_SARIF_projection
|
|
16
16
|
- semantic_diff_and_declared_review_obligations
|
|
17
17
|
- explicit_TypeScript_5_9_3_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
|
|
21
21
|
- historical_document_reconstruction_or_inference
|
|
@@ -25,7 +25,7 @@ methodology:
|
|
|
25
25
|
- implementation_or_review_completion
|
|
26
26
|
- host_workflow_commands
|
|
27
27
|
- storage_semantic_search_visualization_or_Atlas
|
|
28
|
-
-
|
|
28
|
+
- code_location_inbound_impact_structural_advice_semantic_code_context_for_non_TypeScript_languages_or_task_completion
|
|
29
29
|
authority_order:
|
|
30
30
|
- host_canonical_authority_under_.nimi/spec
|
|
31
31
|
- projected_compact_authoring_methodology
|
|
@@ -39,4 +39,5 @@ methodology:
|
|
|
39
39
|
audit: explicit_project_verifier_bindings_not_prose_inference_plugin_execution_or_product_authority
|
|
40
40
|
impact: declared_relation_impact_and_host_follow_up_targets_not_implementation_consumer_or_test_sync_proof
|
|
41
41
|
code_context: current_filesystem_complete_selected_TypeScript_Program_root_direct_static_outbound_projection_not_location_impact_runtime_dispatch_or_task_context
|
|
42
|
+
code_authority: reserved_exact_physical_markers_in_tracked_current_TypeScript_TSX_Go_Python_and_Rust_not_language_comment_proof_or_implementation_conformance
|
|
42
43
|
authority_admission: nimicoding_authority_check_on_complete_canonical_root
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimiplatform/nimi-coding",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Canonical authority products and bounded read-only code
|
|
5
|
+
"description": "Canonical authority products and bounded read-only code queries for AI coding systems.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://docs.nimi.ai/nimicoding",
|
|
8
8
|
"repository": {
|
|
@@ -3,19 +3,24 @@ spec:
|
|
|
3
3
|
id: nimicoding.code-authority-annotations.v1
|
|
4
4
|
owner: nimi-coding
|
|
5
5
|
status: experimental
|
|
6
|
-
product_claim:
|
|
7
|
-
command: nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-or-.
|
|
6
|
+
product_claim: reserved_exact_standalone_physical_markers_link_selected_tracked_current_source_to_current_canonical_authority_lifecycle
|
|
7
|
+
command: nimicoding code authority --repo <exact-git-worktree-root> (--authority <exact-id>|--source <repo-relative-.ts-.tsx-.go-.py-or-.rs-path>|--audit) --max-files <integer> --max-bytes <integer>=512
|
|
8
8
|
markers:
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
slash_prefix_languages: [TypeScript, TSX, Go, Rust]
|
|
10
|
+
slash_authority: "// @nimi-authority: <exact-authority-id>"
|
|
11
|
+
slash_deprecated: "// @nimi-deprecated: <exact-authority-id>"
|
|
12
|
+
python_authority: "# @nimi-authority: <exact-authority-id>"
|
|
13
|
+
python_deprecated: "# @nimi-deprecated: <exact-authority-id>"
|
|
11
14
|
optional: true
|
|
12
15
|
attachment: source_file_with_exact_marker_and_bounded_nearby_source_only
|
|
16
|
+
language_comment_context: not_evaluated
|
|
13
17
|
declaration_ownership: not_evaluated
|
|
14
18
|
deprecated_pairing: not_evaluated
|
|
15
19
|
scan:
|
|
16
20
|
authority_corpus: complete_repository_.nimi/spec
|
|
17
21
|
source_inventory: Git_tracked_current_filesystem
|
|
18
|
-
source_languages: [TypeScript, TSX, Go]
|
|
22
|
+
source_languages: [TypeScript, TSX, Go, Python, Rust]
|
|
23
|
+
marker_detection: exact_physical_line_without_language_parser
|
|
19
24
|
persistent_index_or_cache: none
|
|
20
25
|
ordering: deterministic
|
|
21
26
|
operations:
|
package/spec/product-scope.yaml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
version:
|
|
1
|
+
version: 12
|
|
2
2
|
product:
|
|
3
3
|
package_name: "@nimiplatform/nimi-coding"
|
|
4
4
|
mission: canonical_authority_products_bounded_read_only_code_context_and_explicit_code_authority_marker_lookup
|
|
@@ -13,7 +13,7 @@ owned_surfaces:
|
|
|
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_TypeScript_5_9_3_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}
|
|
19
19
|
sole_conformance_gate: nimicoding_authority_check_complete_.nimi/spec
|