project-librarian 0.5.1 → 0.5.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/README.ko.md CHANGED
@@ -208,6 +208,7 @@ npx project-librarian@latest install --scope project --agents all
208
208
  | 위키 그래프 시각화 생성 | "Project Librarian 위키 그래프 시각화를 생성해줘." | `--wiki-visualize` |
209
209
  | 후보 메모 저장 | "이 내용을 Project Librarian 후보 메모로 저장해줘: <내용>." | `--capture-inbox --title "Candidate" --content "Details"` |
210
210
  | 오래되었거나 미해결인 위키 페이지 보고 | "Project Librarian에서 오래되었거나 미해결인 페이지를 확인해줘." | `--prune-check` |
211
+ | 신호가 높은 오래되었거나 미해결인 위키 페이지만 보고 | "Project Librarian에서 엄격한 기준으로 오래되었거나 미해결인 페이지를 확인해줘." | `--prune-check --prune-check-strict` |
211
212
  | git 설정 변경 없이 훅 파일 설치 | "git 설정은 바꾸지 말고 Project Librarian 훅 파일만 설정해줘." | `--no-git-config` |
212
213
 
213
214
  코드 근거:
@@ -386,6 +387,7 @@ node .codex/skills/project-librarian/dist/init-project-wiki.js install [--scope
386
387
  | `--issue-create --issue-title <title>` | 명시적 사용자 승인 후 `gh`로 GitHub 이슈를 생성합니다. |
387
388
  | `--glossary-init` | 선택적 용어집 페이지를 만들고 라우팅합니다. |
388
389
  | `--prune-check` | 오래되거나 미해결인 수명 주기 신호가 있는 active 페이지를 보고합니다. |
390
+ | `--prune-check --prune-check-strict` | `updated` 날짜가 오늘보다 이전이라는 이유만으로 선택된 페이지는 제외합니다. |
389
391
  | `--review-migration`, `--semantic-migrate` | 마이그레이션 coverage와 수신함 상태를 마이그레이션 검토 파일에 동기화합니다. |
390
392
  | `--no-git-config` | `git core.hooksPath`를 바꾸지 않고 훅 파일을 설치합니다. |
391
393
  | `--code-index` | 폐기 가능한 코드 근거 인덱스를 빌드합니다. |
package/README.md CHANGED
@@ -208,6 +208,7 @@ Wiki setup and maintenance:
208
208
  | Generate a wiki graph visualizer | "Generate the Project Librarian wiki graph visualizer." | `--wiki-visualize` |
209
209
  | Capture a candidate note | "Capture this as a Project Librarian candidate note: <details>." | `--capture-inbox --title "Candidate" --content "Details"` |
210
210
  | Report stale or unresolved wiki pages | "Check Project Librarian for stale or unresolved pages." | `--prune-check` |
211
+ | Report only higher-signal stale or unresolved wiki pages | "Check Project Librarian for strict stale or unresolved pages." | `--prune-check --prune-check-strict` |
211
212
  | Install hook files without changing git config | "Set up Project Librarian hook files without changing git config." | `--no-git-config` |
212
213
 
213
214
  Code evidence:
@@ -386,6 +387,7 @@ Important options:
386
387
  | `--issue-create --issue-title <title>` | Create a GitHub issue through `gh` after explicit user approval. |
387
388
  | `--glossary-init` | Create and route the optional glossary page. |
388
389
  | `--prune-check` | Report active pages with stale or unresolved lifecycle signals. |
390
+ | `--prune-check --prune-check-strict` | Omit pages selected only because their `updated` date is older than today. |
389
391
  | `--review-migration`, `--semantic-migrate` | Sync migration coverage and inbox statuses into migration review files. |
390
392
  | `--no-git-config` | Install hook files without changing `git core.hooksPath`. |
391
393
  | `--code-index` | Build the disposable code evidence index. |
package/dist/args.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.codeQuerySql = exports.codeImpactTarget = exports.codeContextPackTarget = exports.wikiVisualizeOutput = exports.wikiVisualizeMode = exports.wikiImpactTarget = exports.wikiImpactMode = exports.queryTerm = exports.codeSearchSymbolMode = exports.codeQueryMode = exports.codeImpactMode = exports.codeParserMode = exports.codeContextPackMode = exports.codeFilesMode = exports.codeStatusMode = exports.codeReportMode = exports.codeIndexHealthMode = exports.codeIndexFullMode = exports.codeIndexIncrementalMode = exports.codeIndexMode = exports.acknowledgeSmallRepoMode = exports.noGitConfigMode = exports.reviewMigrationMode = exports.pruneCheckMode = exports.captureInboxMode = exports.refreshIndexMode = exports.issueDraftMode = exports.issueCreateMode = exports.glossaryMode = exports.fixMode = exports.doctorMode = exports.qualityCheckMode = exports.linkCheckMode = exports.migrationQualityCheckMode = exports.migrationLintMode = exports.migrationDoctorMode = exports.lintMode = exports.migrateMode = exports.invalidAgentTargets = exports.missingValueOptions = exports.unexpectedValueOptions = exports.unknownOptions = exports.args = exports.commandArgs = exports.command = exports.unknownCommand = exports.helpMode = exports.agentTargets = exports.parsedArgs = exports.rawArgs = void 0;
4
- exports.issueDraftTitle = exports.issueBodyFile = exports.captureCategory = exports.captureContent = exports.captureTitle = exports.codeIndexScopes = exports.codeParser = exports.codeIndexOutput = exports.codeSearchSymbol = exports.codeReportSection = void 0;
3
+ exports.codeImpactTarget = exports.codeContextPackTarget = exports.wikiVisualizeOutput = exports.wikiVisualizeMode = exports.wikiImpactTarget = exports.wikiImpactMode = exports.queryTerm = exports.codeSearchSymbolMode = exports.codeQueryMode = exports.codeImpactMode = exports.codeParserMode = exports.codeContextPackMode = exports.codeFilesMode = exports.codeStatusMode = exports.codeReportMode = exports.codeIndexHealthMode = exports.codeIndexFullMode = exports.codeIndexIncrementalMode = exports.codeIndexMode = exports.acknowledgeSmallRepoMode = exports.noGitConfigMode = exports.reviewMigrationMode = exports.pruneCheckStrictMode = exports.pruneCheckMode = exports.captureInboxMode = exports.refreshIndexMode = exports.issueDraftMode = exports.issueCreateMode = exports.glossaryMode = exports.fixMode = exports.doctorMode = exports.qualityCheckMode = exports.linkCheckMode = exports.migrationQualityCheckMode = exports.migrationLintMode = exports.migrationDoctorMode = exports.lintMode = exports.migrateMode = exports.invalidAgentTargets = exports.missingValueOptions = exports.unexpectedValueOptions = exports.unknownOptions = exports.args = exports.commandArgs = exports.command = exports.unknownCommand = exports.helpMode = exports.agentTargets = exports.parsedArgs = exports.rawArgs = void 0;
4
+ exports.issueDraftTitle = exports.issueBodyFile = exports.captureCategory = exports.captureContent = exports.captureTitle = exports.codeIndexScopes = exports.codeParser = exports.codeIndexOutput = exports.codeSearchSymbol = exports.codeReportSection = exports.codeQuerySql = void 0;
5
5
  exports.parseArgs = parseArgs;
6
6
  exports.argValue = argValue;
7
7
  exports.argValues = argValues;
@@ -46,6 +46,7 @@ const flagDefinitions = [
46
46
  { name: "--migration-quality-check", value: "none" },
47
47
  { name: "--no-git-config", value: "none" },
48
48
  { name: "--prune-check", value: "none" },
49
+ { name: "--prune-check-strict", value: "none" },
49
50
  { name: "--quality-check", value: "none" },
50
51
  { name: "--query", value: "value" },
51
52
  { name: "--refresh-index", value: "none" },
@@ -185,6 +186,7 @@ function parseArgs(argv) {
185
186
  missingValueOptions: Array.from(flagsWithValues).filter((flag) => hasFlag(flag) && !flagHasValue(commandArgs, flag)),
186
187
  noGitConfigMode: args.has("--no-git-config"),
187
188
  pruneCheckMode: args.has("--prune-check"),
189
+ pruneCheckStrictMode: args.has("--prune-check-strict"),
188
190
  qualityCheckMode: args.has("--quality-check"),
189
191
  queryTerm: argValue("--query"),
190
192
  rawArgs: argv,
@@ -231,6 +233,7 @@ exports.issueDraftMode = exports.parsedArgs.issueDraftMode;
231
233
  exports.refreshIndexMode = exports.parsedArgs.refreshIndexMode;
232
234
  exports.captureInboxMode = exports.parsedArgs.captureInboxMode;
233
235
  exports.pruneCheckMode = exports.parsedArgs.pruneCheckMode;
236
+ exports.pruneCheckStrictMode = exports.parsedArgs.pruneCheckStrictMode;
234
237
  exports.reviewMigrationMode = exports.parsedArgs.reviewMigrationMode;
235
238
  exports.noGitConfigMode = exports.parsedArgs.noGitConfigMode;
236
239
  exports.acknowledgeSmallRepoMode = exports.parsedArgs.acknowledgeSmallRepoMode;
@@ -42,6 +42,7 @@ Options:
42
42
  --glossary-init Create and route the optional glossary page.
43
43
  --agents <list> With init/update, write only selected agent surfaces: codex, claude, cursor, gemini, or all. Existing project skill/setup surfaces are preserved by default.
44
44
  --prune-check Report active pages with stale or unresolved signals.
45
+ --prune-check-strict With --prune-check, omit age-only candidates and show only higher-signal lifecycle items.
45
46
  --review-migration Sync unit coverage and compatible inbox statuses into migration review files.
46
47
  --no-git-config Install hook files without changing git core.hooksPath.
47
48
  --code-index Build the disposable .project-wiki code evidence index.
@@ -136,6 +137,10 @@ if (args_1.wikiVisualizeOutput && !args_1.wikiVisualizeMode) {
136
137
  console.error("--wiki-visualize-out is only supported with --wiki-visualize.");
137
138
  process.exit(1);
138
139
  }
140
+ if (args_1.pruneCheckStrictMode && !args_1.pruneCheckMode) {
141
+ console.error("--prune-check-strict is only supported with --prune-check.");
142
+ process.exit(1);
143
+ }
139
144
  if (args_1.codeIndexIncrementalMode && !args_1.codeIndexMode) {
140
145
  console.error("--incremental is only supported with --code-index.");
141
146
  process.exit(1);
@@ -217,7 +222,7 @@ function runInitCommand() {
217
222
  return;
218
223
  }
219
224
  if (args_1.pruneCheckMode) {
220
- (0, modes_1.runPruneCheckMode)();
225
+ (0, modes_1.runPruneCheckMode)({ strict: args_1.pruneCheckStrictMode });
221
226
  process.exit(0);
222
227
  }
223
228
  if (args_1.reviewMigrationMode) {
package/dist/modes.js CHANGED
@@ -40,6 +40,7 @@ exports.projectCandidatesContent = projectCandidatesContent;
40
40
  exports.appendCaptureInbox = appendCaptureInbox;
41
41
  exports.runIssueDraftMode = runIssueDraftMode;
42
42
  exports.runIssueCreateMode = runIssueCreateMode;
43
+ exports.buildPruneCandidate = buildPruneCandidate;
43
44
  exports.runPruneCheckMode = runPruneCheckMode;
44
45
  exports.collectLinkDiagnostics = collectLinkDiagnostics;
45
46
  exports.collectQualityDiagnostics = collectQualityDiagnostics;
@@ -69,6 +70,7 @@ const wiki_diagnostics_1 = require("./wiki-diagnostics");
69
70
  const scopedAutoIndexThreshold = 40;
70
71
  const scopedAutoIndexCharLimit = 7600;
71
72
  const scopedAutoIndexMarker = "<!-- PROJECT-WIKI-SCOPED-AUTO-INDEX -->";
73
+ const pruneCheckAgeReasonPrefix = "updated before today:";
72
74
  function isScopedAutoIndex(file) {
73
75
  return /^wiki\/indexes\/auto-[a-z0-9-]+\.md$/.test(file);
74
76
  }
@@ -547,27 +549,32 @@ function runIssueCreateMode() {
547
549
  fs.rmSync(body.cleanupDir, { recursive: true, force: true });
548
550
  }
549
551
  }
550
- function runPruneCheckMode() {
552
+ function buildPruneCandidate(file, text, options = {}) {
553
+ const status = (0, workspace_1.metadataValue)(text, "status");
554
+ const updated = (0, workspace_1.metadataValue)(text, "updated");
555
+ const trigger = (0, workspace_1.metadataValue)(text, "review_trigger");
556
+ const scope = (0, workspace_1.metadataValue)(text, "scope");
557
+ const body = (0, workspace_1.stripMetadataHeader)(text);
558
+ const reasons = [];
559
+ const lifecycleScope = /project-canonical|project-decisions|inbox|migration-inbox/.test(scope);
560
+ if (status === "active" && lifecycleScope && /pending|proposed|undecided|TODO|TBD|미정/i.test(body))
561
+ reasons.push("contains pending/proposed/undecided signal");
562
+ if (status === "active" && trigger && /stale|old|expired|due|오래|도래|만료/i.test(trigger))
563
+ reasons.push(`review trigger: ${trigger}`);
564
+ if (updated && updated < (options.today ?? workspace_1.today) && status === "active")
565
+ reasons.push(`${pruneCheckAgeReasonPrefix} ${updated}`);
566
+ if (options.strict && !reasons.some((reason) => !reason.startsWith(pruneCheckAgeReasonPrefix)))
567
+ return null;
568
+ return reasons.length > 0 ? { file, status, updated, reasons } : null;
569
+ }
570
+ function runPruneCheckMode(options = {}) {
551
571
  const candidates = [];
552
572
  for (const file of (0, wiki_files_1.wikiMarkdownFiles)()) {
553
- const text = (0, workspace_1.read)(file);
554
- const status = (0, workspace_1.metadataValue)(text, "status");
555
- const updated = (0, workspace_1.metadataValue)(text, "updated");
556
- const trigger = (0, workspace_1.metadataValue)(text, "review_trigger");
557
- const scope = (0, workspace_1.metadataValue)(text, "scope");
558
- const body = (0, workspace_1.stripMetadataHeader)(text);
559
- const reasons = [];
560
- const lifecycleScope = /project-canonical|project-decisions|inbox|migration-inbox/.test(scope);
561
- if (status === "active" && lifecycleScope && /pending|proposed|undecided|TODO|TBD|미정/i.test(body))
562
- reasons.push("contains pending/proposed/undecided signal");
563
- if (status === "active" && trigger && /stale|old|expired|due|오래|도래|만료/i.test(trigger))
564
- reasons.push(`review trigger: ${trigger}`);
565
- if (updated && updated < workspace_1.today && status === "active")
566
- reasons.push(`updated before today: ${updated}`);
567
- if (reasons.length > 0)
568
- candidates.push({ file, status, updated, reasons });
573
+ const candidate = buildPruneCandidate(file, (0, workspace_1.read)(file), options);
574
+ if (candidate)
575
+ candidates.push(candidate);
569
576
  }
570
- console.log("Project wiki prune-check");
577
+ console.log(options.strict ? "Project wiki prune-check (strict)" : "Project wiki prune-check");
571
578
  if (candidates.length === 0)
572
579
  console.log("no candidates");
573
580
  for (const item of candidates) {
package/dist/templates.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultStarterFilePaths = exports.starterFiles = exports.documentTaxonomy = exports.decisionPolicy = exports.wikiOperatingModel = exports.inboxIndexBlock = exports.glossaryIndexBlock = exports.glossary = exports.index = exports.startup = exports.metadata = exports.wikiAgentsSection = exports.cursorRule = exports.geminiSection = exports.claudeSection = exports.STARTUP_TLDR_MAX_CHARS = exports.startupTldrSyncLabel = exports.codeEvidenceTrustContract = exports.wikiTrustContract = void 0;
3
+ exports.defaultStarterFilePaths = exports.starterFiles = exports.documentTaxonomy = exports.decisionPolicy = exports.wikiOperatingModel = exports.inboxIndexBlock = exports.glossaryIndexBlock = exports.glossary = exports.index = exports.startup = exports.metadata = exports.wikiAgentsSection = exports.cursorRule = exports.geminiSection = exports.claudeSection = exports.STARTUP_TLDR_MAX_CHARS = exports.startupTldrSyncLabel = exports.guidanceClaimEvidenceContract = exports.codeEvidenceTrustContract = exports.wikiTrustContract = void 0;
4
4
  exports.extractStartupTldr = extractStartupTldr;
5
5
  exports.agentsSection = agentsSection;
6
6
  const workspace_1 = require("./workspace");
@@ -16,6 +16,10 @@ exports.wikiTrustContract = "Wiki decision documents are authoritative for proje
16
16
  // closing clause is the scale-conditional guidance (2026-06-12 decision, stageR1
17
17
  // evidence): on small repos simple lookups measured cheaper via direct reads.
18
18
  exports.codeEvidenceTrustContract = "Code-evidence tool and report outputs (`--code-impact`, `--code-report`, and the `project-librarian mcp` tools) are authoritative for code-structure questions: do not re-verify them with repo-wide greps unless `--code-status`/`code_status` reports staleness; on small repos below the measured scale threshold, prefer direct reads over these tools for simple lookups (measured cheaper at small scale).";
19
+ // Guidance-refinement analogue for agent-instruction changes. The measured
20
+ // evidence is scoped to local probe reports, not transferred across models,
21
+ // surfaces, repos, or user projects without their own passing claim gate.
22
+ exports.guidanceClaimEvidenceContract = "Guidance-refinement claims are evidence-scoped: do not promote or claim an agent-instruction improvement unless a local guidance-probe or equivalent report has a passed claim gate with complete measured pairs, variant digests, and zero read-only file changes where requested; otherwise describe it as an unverified candidate.";
19
23
  // B1 fallback: label for the auto-synced startup TL;DR sub-block embedded in the
20
24
  // managed AGENTS.md marker section. Non-interactive `codex exec` does not run
21
25
  // SessionStart hooks (measured 2026-06-10), so AGENTS.md is the only startup
@@ -85,6 +89,7 @@ During conversation:
85
89
  - Let \`.githooks/prepare-commit-msg\` append wiki trailers automatically for staged wiki, hook, AGENTS, or project-librarian files.
86
90
  - ${exports.wikiTrustContract}
87
91
  - ${exports.codeEvidenceTrustContract}
92
+ - ${exports.guidanceClaimEvidenceContract}
88
93
  <!-- PROJECT-WIKI-FIRST:END -->`;
89
94
  }
90
95
  exports.claudeSection = `<!-- PROJECT-WIKI-CLAUDE:START -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-librarian",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Create and maintain compact project context for humans and LLM coding agents.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -46,6 +46,8 @@
46
46
  "benchmark:llm:parse-smoke": "node tests/validators/codex-llm-benchmark-smoke.js",
47
47
  "benchmark:llm:prune-raw": "node benchmarks/tools/prune-llm-raw.js",
48
48
  "benchmark:llm:raw-audit": "node benchmarks/tools/audit-llm-raw.js",
49
+ "benchmark:guidance": "npm run build && node benchmarks/tools/guidance-probe-runner.js",
50
+ "benchmark:guidance:dry-run": "npm run build && node benchmarks/tools/guidance-probe-runner.js --dry-run --markdown",
49
51
  "benchmark:injection-sentinel": "node benchmarks/tools/injection-sentinel.js",
50
52
  "benchmark:agent-surface-smoke": "node benchmarks/tools/agent-surface-smoke.js",
51
53
  "benchmark:claim-ledger": "node benchmarks/tools/benchmark-claim-ledger.js benchmarks/llm/samples/codex-measured-report.json benchmarks/reports/llm/payload-preview.json",