@longzai-intelligence-issues/ledger 0.0.1 → 0.0.3

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.
@@ -131,6 +131,82 @@ export const CANONICAL_STATUS_LABELS: Readonly<
131
131
  canceled: '⚫ 已取消',
132
132
  };
133
133
 
134
+ /**
135
+ * pre-emoji 存量状态词表(写侧迁移单一真源)
136
+ *
137
+ * 读侧归类(classifyStatusLine)不消费本词表——旧词表形态归 unknown 由 lint
138
+ * status-line-missing 拦截,迁移经由 migrate-legacy 写侧规范化后回归规范五态,
139
+ * 避免为读侧新增 legacy-red 等形态破坏 IssueStatus 契约面。
140
+ */
141
+ export const LEGACY_STATUS_VOCABULARY: Readonly<{
142
+ /**
143
+ * 绿系词(历史已结案标记)
144
+ */
145
+ green: readonly string[];
146
+
147
+ /**
148
+ * 红系词(历史待办标记)
149
+ */
150
+ red: readonly string[];
151
+
152
+ /**
153
+ * 延期系词(已登记(延期)族——迁移默认回红灯并保留延期说明)
154
+ */
155
+ deferred: readonly string[];
156
+
157
+ /**
158
+ * 取消系词
159
+ */
160
+ canceled: readonly string[];
161
+
162
+ /**
163
+ * 进行系词(黄灯候选)
164
+ */
165
+ inProgress: readonly string[];
166
+
167
+ /**
168
+ * 冻结系词(不迁移——冻结唯一合法写入路径是 freeze 命令)
169
+ */
170
+ frozen: readonly string[];
171
+ }> = {
172
+ green: [
173
+ '已解决',
174
+ '已修复',
175
+ '已治理',
176
+ '已处理',
177
+ '已处置',
178
+ '已完成',
179
+ '已闭合',
180
+ '已消解',
181
+ '已闭环',
182
+ '已清治',
183
+ '已收口',
184
+ '已根治',
185
+ '已终态',
186
+ '已裁决',
187
+ '已决策',
188
+ '已验证',
189
+ '已全部清治',
190
+ '全量完成',
191
+ '终态达成',
192
+ ],
193
+ red: [
194
+ '未处理',
195
+ '待处理',
196
+ '待治理',
197
+ '待修复',
198
+ '未修复',
199
+ '待验证',
200
+ '待评估',
201
+ '紧急',
202
+ '已立项待治理',
203
+ ],
204
+ deferred: ['已登记'],
205
+ canceled: ['已取消'],
206
+ inProgress: ['处理中', '进行中'],
207
+ frozen: ['已冻结'],
208
+ };
209
+
134
210
  /**
135
211
  * issue 引用 token 形态
136
212
  *
@@ -497,6 +497,14 @@ export function parseIssueDoc(
497
497
  */
498
498
  const line = lines[index] ?? '';
499
499
 
500
+ /**
501
+ * 标题行跳过(标题正文可含「连接状态:」类词组——如 printer 刷屏案
502
+ * 标题,非元信息状态行;命中会吞掉后续真状态行致 status-line-missing)
503
+ */
504
+ if (line.startsWith('#')) {
505
+ continue;
506
+ }
507
+
500
508
  if (STATUS_LINE_LOCATE_PATTERN.test(line)) {
501
509
  statusLine = line.trim();
502
510
  statusLineNumber = index + 1;
@@ -241,13 +241,24 @@ export function renderCriteriaBlockExample(): string {
241
241
  /**
242
242
  * 渲染注册表 README 格式存根(init 命令落盘)
243
243
  *
244
- * 一页式格式速览:建档入口、状态行五态、正文四段;完整规范指向格式真源指南。
244
+ * 一页式格式速览:建档入口、状态行五态、正文四段;完整规范指向格式真源指南
245
+ * (采用仓不携带指南文件时回退机器真源提示,不落死链)。
245
246
  *
246
247
  * @param scopeTitle - scope 人类可读名
247
- * @param guideRelPath - 格式指南相对本注册表目录的路径(如 `../../docs/guides/issue-file-format.md`)
248
+ * @param guideRelPath - 格式指南相对本注册表目录的路径;指南不在采用仓时为 null
248
249
  * @returns README 存根全文
249
250
  */
250
- export function renderRegistryReadmeStub(scopeTitle: string, guideRelPath: string): string {
251
+ export function renderRegistryReadmeStub(scopeTitle: string, guideRelPath: string | null): string {
252
+ /**
253
+ * 指南指引行(链接形态或机器真源回退形态)
254
+ */
255
+ const guideLine =
256
+ guideRelPath === null
257
+ ? '- 标准模板:`lzi-issues template`(字段契约 `--format json`);完整格式规范见 lzi-issues 仓 docs/guides/issue-file-format.md(本仓未携带指南文件,不落链接)'
258
+ : '- 标准模板:`lzi-issues template`;完整格式规范:[issue-file-format](' +
259
+ guideRelPath +
260
+ ')';
261
+
251
262
  return [
252
263
  `# ${scopeTitle} issue 注册表`,
253
264
  '',
@@ -256,7 +267,7 @@ export function renderRegistryReadmeStub(scopeTitle: string, guideRelPath: strin
256
267
  '## 建档',
257
268
  '',
258
269
  '- `lzi-issues create --title <标题> --scope <key>`(编号走门禁取号,禁止手工定号)',
259
- '- 标准模板:`lzi-issues template`;完整格式规范:[issue-file-format](' + guideRelPath + ')',
270
+ guideLine,
260
271
  '',
261
272
  '## 状态行(处理情况第一入口)',
262
273
  '',