@llman-sdd/cli 0.5.0 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llman-sdd/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Spec-driven development workflow CLI (the `llman-sdd` command)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "build": "bun run ./scripts/build-binary.ts"
28
28
  },
29
29
  "dependencies": {
30
- "@llman-sdd/core": "0.5.0",
30
+ "@llman-sdd/core": "0.5.1",
31
31
  "commander": "^15.0.0"
32
32
  },
33
33
  "engines": {
@@ -1,4 +1,4 @@
1
- import { migrateNoteFor, migrateOverviewFor, planDedupe } from '@llman-sdd/core';
1
+ import { buildReqRegistry, migrateNoteFor, migrateOverviewFor, planDedupe } from '@llman-sdd/core';
2
2
  import type { Command } from 'commander';
3
3
 
4
4
  import { CliError, loadCliConfig, loadSpecEntries, newIo } from '../cli-shared.ts';
@@ -11,20 +11,10 @@ export function registerProject(program: Command): void {
11
11
  .description('Remap globally duplicated req ids (report with --dry-run)')
12
12
  .option('--dry-run', 'report the remap plan without writing')
13
13
  .action((options: { dryRun?: boolean }) => {
14
- // dedupe registry covers requirement handles (`@req` on 规则: headers) only.
14
+ // dedupe registry covers requirement handles (`@req` on 规则: headers) only;
15
+ // duplicates follow the occurrence model (同文件内共用或跨文件均算)
15
16
  const entries = loadSpecEntries();
16
- const owners = new Map<string, string[]>();
17
- for (const e of entries) {
18
- for (const rule of e.doc.rules) {
19
- if (rule.reqId === '') continue;
20
- const list = owners.get(rule.reqId) ?? [];
21
- if (!list.includes(e.fileName)) list.push(e.fileName);
22
- owners.set(rule.reqId, list);
23
- }
24
- }
25
- const duplicates = [...owners.entries()]
26
- .filter(([, files]) => files.length > 1)
27
- .map(([reqId, files]) => ({ reqId, files }));
17
+ const { duplicates } = buildReqRegistry(entries);
28
18
  if (duplicates.length === 0) {
29
19
  console.log('No colliding req_id values in llmanspec/specs.');
30
20
  return;