@phren/cli 0.1.14 → 0.1.16
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.md +1 -1
- package/dist/capabilities/cli.js +1 -1
- package/dist/capabilities/mcp.js +1 -1
- package/dist/capabilities/vscode.js +1 -1
- package/dist/capabilities/web-ui.js +1 -1
- package/dist/cli/extract.js +2 -1
- package/dist/cli/govern.js +3 -2
- package/dist/cli/namespaces-projects.js +7 -6
- package/dist/cli/ops.js +2 -2
- package/dist/cli/session-start.js +2 -1
- package/dist/cli/team.js +7 -5
- package/dist/cli-hooks-session-handlers.js +2 -1
- package/dist/content/archive.js +2 -1
- package/dist/content/citation.d.ts +4 -0
- package/dist/content/citation.js +14 -5
- package/dist/content/dedup.js +6 -5
- package/dist/content/learning.d.ts +1 -3
- package/dist/content/learning.js +17 -62
- package/dist/content/validate.js +2 -1
- package/dist/core/project.js +2 -1
- package/dist/data/access.d.ts +2 -7
- package/dist/data/access.js +14 -20
- package/dist/finding/journal.js +2 -2
- package/dist/finding/lifecycle.js +2 -1
- package/dist/governance/policy.d.ts +2 -0
- package/dist/governance/policy.js +2 -2
- package/dist/hooks.js +38 -2
- package/dist/init/init-uninstall.js +2 -1
- package/dist/init/setup.js +5 -4
- package/dist/init-uninstall.js +2 -1
- package/dist/link/checksums.js +2 -1
- package/dist/link/context.js +2 -1
- package/dist/link/doctor.js +4 -3
- package/dist/link/link.js +2 -1
- package/dist/phren-paths.js +3 -2
- package/dist/profile-store.d.ts +1 -0
- package/dist/profile-store.js +15 -16
- package/dist/project-topics.js +4 -3
- package/dist/shell/input.js +3 -3
- package/dist/status.js +2 -2
- package/dist/tools/data.js +4 -4
- package/dist/tools/extract.js +3 -2
- package/dist/tools/finding.js +10 -15
- package/dist/tools/search.js +5 -14
- package/dist/tools/session.js +2 -16
- package/dist/ui/data.js +6 -5
- package/dist/ui/server.js +3 -3
- package/package.json +1 -1
package/dist/data/access.js
CHANGED
|
@@ -8,7 +8,7 @@ import { phrenErr, PhrenError, phrenOk, forwardErr, getProjectDirs, isRecord, }
|
|
|
8
8
|
import { normalizeQueueEntryText, } from "../shared/governance.js";
|
|
9
9
|
import { addFindingToFile, } from "../shared/content.js";
|
|
10
10
|
import { isValidProjectName, queueFilePath, safeProjectPath } from "../utils.js";
|
|
11
|
-
import { parseCitationComment, parseSourceComment, } from "../content/citation.js";
|
|
11
|
+
import { parseCitationComment, parseScopeComment, parseSourceComment, } from "../content/citation.js";
|
|
12
12
|
import { parseFindingLifecycle, } from "../finding/lifecycle.js";
|
|
13
13
|
import { METADATA_REGEX, isCitationLine, isArchiveStart, isArchiveEnd, parseFindingId, parseAllContradictions, stripComments, normalizeFindingText, } from "../content/metadata.js";
|
|
14
14
|
import { withSafeLock, ensureProject } from "../shared/data-utils.js";
|
|
@@ -17,6 +17,7 @@ export { readTasks, readTasksAcrossProjects, resolveTaskItem, addTask, addTasks,
|
|
|
17
17
|
export { addProjectToProfile, listMachines, listProfiles, listProjectCards, removeProjectFromProfile, setMachineProfile, } from "../profile-store.js";
|
|
18
18
|
export { loadShellState, resetShellState, saveShellState, } from "../shell/state-store.js";
|
|
19
19
|
export { getRuntimeHealth as readRuntimeHealth } from "../shared/governance.js";
|
|
20
|
+
export const FINDINGS_FILENAME = "FINDINGS.md";
|
|
20
21
|
function extractDateHeading(line) {
|
|
21
22
|
const heading = line.match(/^##\s+(.+)$/);
|
|
22
23
|
if (!heading)
|
|
@@ -105,7 +106,7 @@ export function readFindings(phrenPath, project, opts = {}) {
|
|
|
105
106
|
const ensured = ensureProject(phrenPath, project);
|
|
106
107
|
if (!ensured.ok)
|
|
107
108
|
return forwardErr(ensured);
|
|
108
|
-
const findingsPath = path.join(ensured.data,
|
|
109
|
+
const findingsPath = path.join(ensured.data, FINDINGS_FILENAME);
|
|
109
110
|
const file = findingsPath;
|
|
110
111
|
if (!fs.existsSync(file))
|
|
111
112
|
return phrenOk([]);
|
|
@@ -161,7 +162,6 @@ export function readFindings(phrenPath, project, opts = {}) {
|
|
|
161
162
|
id: `L${index}`,
|
|
162
163
|
date,
|
|
163
164
|
text: syntheticText,
|
|
164
|
-
source: "unknown",
|
|
165
165
|
status: "active",
|
|
166
166
|
archived: inArchiveBlock,
|
|
167
167
|
tier: inArchiveBlock ? "archived" : "current",
|
|
@@ -174,7 +174,7 @@ export function readFindings(phrenPath, project, opts = {}) {
|
|
|
174
174
|
const next = lines[i + 1] || "";
|
|
175
175
|
const citation = isCitationLine(next) ? next.trim() : undefined;
|
|
176
176
|
const citationData = citation ? parseCitationComment(citation) ?? undefined : undefined;
|
|
177
|
-
const
|
|
177
|
+
const scope = parseScopeComment(line) ?? parseSourceComment(line)?.scope;
|
|
178
178
|
const stableId = parseFindingId(line);
|
|
179
179
|
const rawText = line.replace(/^-\s+/, "").trim();
|
|
180
180
|
const textWithoutComments = stripComments(rawText);
|
|
@@ -194,16 +194,10 @@ export function readFindings(phrenPath, project, opts = {}) {
|
|
|
194
194
|
date,
|
|
195
195
|
text,
|
|
196
196
|
confidence,
|
|
197
|
-
source: source?.source ?? "unknown",
|
|
198
197
|
citation,
|
|
199
198
|
citationData,
|
|
200
199
|
taskItem: citationData?.task_item,
|
|
201
|
-
|
|
202
|
-
actor: source?.actor,
|
|
203
|
-
tool: source?.tool,
|
|
204
|
-
model: source?.model,
|
|
205
|
-
sessionId: source?.session_id,
|
|
206
|
-
scope: source?.scope,
|
|
200
|
+
scope,
|
|
207
201
|
supersededBy: supersededByMatch ? supersededByMatch[1] : undefined,
|
|
208
202
|
supersedes: supersedesMatch ? supersedesMatch[1] : undefined,
|
|
209
203
|
contradicts: contradictsMatches.length > 0 ? contradictsMatches : undefined,
|
|
@@ -283,13 +277,13 @@ export function removeFinding(phrenPath, project, match) {
|
|
|
283
277
|
const ensured = ensureProject(phrenPath, project);
|
|
284
278
|
if (!ensured.ok)
|
|
285
279
|
return forwardErr(ensured);
|
|
286
|
-
const findingsPath = path.resolve(path.join(ensured.data,
|
|
280
|
+
const findingsPath = path.resolve(path.join(ensured.data, FINDINGS_FILENAME));
|
|
287
281
|
if (!findingsPath.startsWith(phrenPath + path.sep) && findingsPath !== phrenPath) {
|
|
288
|
-
return phrenErr(
|
|
282
|
+
return phrenErr(`${FINDINGS_FILENAME} path escapes phren store`, PhrenError.VALIDATION_ERROR);
|
|
289
283
|
}
|
|
290
284
|
const filePath = findingsPath;
|
|
291
285
|
if (!fs.existsSync(filePath))
|
|
292
|
-
return phrenErr(`No
|
|
286
|
+
return phrenErr(`No ${FINDINGS_FILENAME} file found for "${project}". Add a finding first with add_finding or :find add.`, PhrenError.FILE_NOT_FOUND);
|
|
293
287
|
return withSafeLock(filePath, () => {
|
|
294
288
|
const lines = fs.readFileSync(filePath, "utf8").split("\n");
|
|
295
289
|
const needle = normalizeFindingText(match);
|
|
@@ -320,12 +314,12 @@ export function removeFindings(phrenPath, project, matches) {
|
|
|
320
314
|
const ensured = ensureProject(phrenPath, project);
|
|
321
315
|
if (!ensured.ok)
|
|
322
316
|
return forwardErr(ensured);
|
|
323
|
-
const findingsPath = path.resolve(path.join(ensured.data,
|
|
317
|
+
const findingsPath = path.resolve(path.join(ensured.data, FINDINGS_FILENAME));
|
|
324
318
|
if (!findingsPath.startsWith(phrenPath + path.sep) && findingsPath !== phrenPath) {
|
|
325
|
-
return phrenErr(
|
|
319
|
+
return phrenErr(`${FINDINGS_FILENAME} path escapes phren store`, PhrenError.VALIDATION_ERROR);
|
|
326
320
|
}
|
|
327
321
|
if (!fs.existsSync(findingsPath))
|
|
328
|
-
return phrenErr(`No
|
|
322
|
+
return phrenErr(`No ${FINDINGS_FILENAME} file found for "${project}". Add a finding first with add_finding or :find add.`, PhrenError.FILE_NOT_FOUND);
|
|
329
323
|
return withSafeLock(findingsPath, () => {
|
|
330
324
|
const lines = fs.readFileSync(findingsPath, "utf8").split("\n");
|
|
331
325
|
const removed = [];
|
|
@@ -374,12 +368,12 @@ export function editFinding(phrenPath, project, oldText, newText) {
|
|
|
374
368
|
const newTextTrimmed = newText.trim();
|
|
375
369
|
if (!newTextTrimmed)
|
|
376
370
|
return phrenErr("New finding text cannot be empty.", PhrenError.EMPTY_INPUT);
|
|
377
|
-
const findingsPath = path.resolve(path.join(ensured.data,
|
|
371
|
+
const findingsPath = path.resolve(path.join(ensured.data, FINDINGS_FILENAME));
|
|
378
372
|
if (!findingsPath.startsWith(phrenPath + path.sep) && findingsPath !== phrenPath) {
|
|
379
|
-
return phrenErr(
|
|
373
|
+
return phrenErr(`${FINDINGS_FILENAME} path escapes phren store`, PhrenError.VALIDATION_ERROR);
|
|
380
374
|
}
|
|
381
375
|
if (!fs.existsSync(findingsPath))
|
|
382
|
-
return phrenErr(`No
|
|
376
|
+
return phrenErr(`No ${FINDINGS_FILENAME} file found for "${project}".`, PhrenError.FILE_NOT_FOUND);
|
|
383
377
|
return withSafeLock(findingsPath, () => {
|
|
384
378
|
const lines = fs.readFileSync(findingsPath, "utf8").split("\n");
|
|
385
379
|
const needle = normalizeFindingText(oldText);
|
package/dist/finding/journal.js
CHANGED
|
@@ -5,6 +5,7 @@ import { runtimeDir, phrenOk, phrenErr, PhrenError, atomicWriteText } from "../s
|
|
|
5
5
|
import { withFileLock } from "../shared/governance.js";
|
|
6
6
|
import { addFindingToFile } from "../shared/content.js";
|
|
7
7
|
import { isValidProjectName, errorMessage } from "../utils.js";
|
|
8
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
8
9
|
function journalRoot(phrenPath) {
|
|
9
10
|
const dir = path.join(runtimeDir(phrenPath), "finding-journal");
|
|
10
11
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -98,7 +99,6 @@ export function compactFindingJournals(phrenPath, project) {
|
|
|
98
99
|
...(entry.commit ? { commit: entry.commit } : {}),
|
|
99
100
|
...(entry.file ? { file: entry.file } : {}),
|
|
100
101
|
}, {
|
|
101
|
-
source: entry.source,
|
|
102
102
|
sessionId: entry.sessionId,
|
|
103
103
|
});
|
|
104
104
|
if (!write.ok) {
|
|
@@ -198,7 +198,7 @@ export function materializeTeamFindings(storePath, project) {
|
|
|
198
198
|
}
|
|
199
199
|
lines.push("");
|
|
200
200
|
}
|
|
201
|
-
const findingsPath = path.join(storePath, project,
|
|
201
|
+
const findingsPath = path.join(storePath, project, FINDINGS_FILENAME);
|
|
202
202
|
try {
|
|
203
203
|
atomicWriteText(findingsPath, lines.join("\n"));
|
|
204
204
|
return phrenOk({ entryCount: count });
|
|
@@ -6,6 +6,7 @@ const LIFECYCLE_PREFIX = "phren";
|
|
|
6
6
|
import { withFileLock } from "../shared/governance.js";
|
|
7
7
|
import { isValidProjectName, safeProjectPath } from "../utils.js";
|
|
8
8
|
import { isArchiveEnd, isArchiveStart, parseCreatedDate as parseCreatedDateMeta, parseStatusField, parseStatus, parseSupersession, parseContradiction, parseFindingId as parseFindingIdMeta, stripLifecycleMetadata, stripRelationMetadata, normalizeFindingText, } from "../content/metadata.js";
|
|
9
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
9
10
|
export const FINDING_TYPE_DECAY = {
|
|
10
11
|
'pattern': { maxAgeDays: 365, decayMultiplier: 1.0 }, // Slow decay, long-lived
|
|
11
12
|
'decision': { maxAgeDays: Infinity, decayMultiplier: 1.0 }, // Never decays
|
|
@@ -198,7 +199,7 @@ function findingsPathForProject(phrenPath, project) {
|
|
|
198
199
|
return phrenErr(`Invalid project name: "${project}"`, PhrenError.INVALID_PROJECT_NAME);
|
|
199
200
|
if (!fs.existsSync(projectDir))
|
|
200
201
|
return phrenErr(`Project "${project}" not found.`, PhrenError.PROJECT_NOT_FOUND);
|
|
201
|
-
const findingsPath = path.join(projectDir,
|
|
202
|
+
const findingsPath = path.join(projectDir, FINDINGS_FILENAME);
|
|
202
203
|
if (!fs.existsSync(findingsPath))
|
|
203
204
|
return phrenErr(`No FINDINGS.md found for "${project}".`, PhrenError.FILE_NOT_FOUND);
|
|
204
205
|
return phrenOk(findingsPath);
|
|
@@ -83,10 +83,12 @@ export interface ResolvedConfig {
|
|
|
83
83
|
retentionPolicy: RetentionPolicy;
|
|
84
84
|
workflowPolicy: WorkflowPolicy;
|
|
85
85
|
}
|
|
86
|
+
export declare const VALID_PROACTIVITY_LEVELS: readonly ["high", "medium", "low"];
|
|
86
87
|
export declare const VALID_TASK_MODES: readonly ["off", "manual", "suggest", "auto"];
|
|
87
88
|
export type TaskMode = typeof VALID_TASK_MODES[number];
|
|
88
89
|
export declare const VALID_FINDING_SENSITIVITY: readonly ["minimal", "conservative", "balanced", "aggressive"];
|
|
89
90
|
export type FindingSensitivityLevel = typeof VALID_FINDING_SENSITIVITY[number];
|
|
91
|
+
export declare const VALID_RISKY_SECTIONS: readonly ["Review", "Stale", "Conflicts"];
|
|
90
92
|
export declare function getProjectConfigOverrides(phrenPath: string, projectName: string): ProjectConfigOverrides | null;
|
|
91
93
|
export declare function mergeConfig(phrenPath: string, projectName?: string, profile?: string): ResolvedConfig;
|
|
92
94
|
export declare function getRetentionPolicy(phrenPath: string, projectName?: string): RetentionPolicy;
|
|
@@ -221,10 +221,10 @@ function normalizeIndexPolicy(data) {
|
|
|
221
221
|
includeHidden: pickBoolean(data.includeHidden, DEFAULT_INDEX_POLICY.includeHidden),
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
const VALID_PROACTIVITY_LEVELS = ["high", "medium", "low"];
|
|
224
|
+
export const VALID_PROACTIVITY_LEVELS = ["high", "medium", "low"];
|
|
225
225
|
export const VALID_TASK_MODES = ["off", "manual", "suggest", "auto"];
|
|
226
226
|
export const VALID_FINDING_SENSITIVITY = ["minimal", "conservative", "balanced", "aggressive"];
|
|
227
|
-
const VALID_RISKY_SECTIONS = ["Review", "Stale", "Conflicts"];
|
|
227
|
+
export const VALID_RISKY_SECTIONS = ["Review", "Stale", "Conflicts"];
|
|
228
228
|
function pickEnum(value, allowed) {
|
|
229
229
|
return typeof value === "string" && allowed.includes(value) ? value : undefined;
|
|
230
230
|
}
|
package/dist/hooks.js
CHANGED
|
@@ -83,6 +83,36 @@ export function buildLifecycleCommands(phrenPath) {
|
|
|
83
83
|
const isWindows = process.platform === "win32";
|
|
84
84
|
const escapedPhren = phrenPath.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
85
85
|
const quotedPhren = shellEscape(phrenPath);
|
|
86
|
+
// Prefer the stable wrapper at ~/.local/bin/phren — it survives nvm switches
|
|
87
|
+
// and npx cache clears because it has a built-in npx fallback.
|
|
88
|
+
const localBinDir = homePath(".local", "bin");
|
|
89
|
+
const wrapperPath = path.join(localBinDir, isWindows ? "phren.cmd" : "phren");
|
|
90
|
+
const wrapperExists = fs.existsSync(wrapperPath) && (() => {
|
|
91
|
+
try {
|
|
92
|
+
return fs.readFileSync(wrapperPath, "utf8").includes("PHREN_CLI_WRAPPER");
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
})();
|
|
98
|
+
if (wrapperExists) {
|
|
99
|
+
if (isWindows) {
|
|
100
|
+
return {
|
|
101
|
+
sessionStart: `set "PHREN_PATH=${escapedPhren}" && "${wrapperPath}" hook-session-start`,
|
|
102
|
+
userPromptSubmit: `set "PHREN_PATH=${escapedPhren}" && "${wrapperPath}" hook-prompt`,
|
|
103
|
+
stop: `set "PHREN_PATH=${escapedPhren}" && "${wrapperPath}" hook-stop`,
|
|
104
|
+
hookTool: `set "PHREN_PATH=${escapedPhren}" && "${wrapperPath}" hook-tool`,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const quotedWrapper = shellEscape(wrapperPath);
|
|
108
|
+
return {
|
|
109
|
+
sessionStart: `PHREN_PATH=${quotedPhren} ${quotedWrapper} hook-session-start`,
|
|
110
|
+
userPromptSubmit: `PHREN_PATH=${quotedPhren} ${quotedWrapper} hook-prompt`,
|
|
111
|
+
stop: `PHREN_PATH=${quotedPhren} ${quotedWrapper} hook-stop`,
|
|
112
|
+
hookTool: `PHREN_PATH=${quotedPhren} ${quotedWrapper} hook-tool`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
// Direct node path — used when wrapper hasn't been installed yet
|
|
86
116
|
if (entry) {
|
|
87
117
|
const escapedEntry = entry.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
88
118
|
const quotedEntry = shellEscape(entry);
|
|
@@ -101,6 +131,7 @@ export function buildLifecycleCommands(phrenPath) {
|
|
|
101
131
|
hookTool: `PHREN_PATH=${quotedPhren} node ${quotedEntry} hook-tool`,
|
|
102
132
|
};
|
|
103
133
|
}
|
|
134
|
+
// Last resort — npx
|
|
104
135
|
const packageSpec = phrenPackageSpec();
|
|
105
136
|
if (isWindows) {
|
|
106
137
|
return {
|
|
@@ -265,14 +296,19 @@ export function installPhrenCliWrapper(phrenPath) {
|
|
|
265
296
|
return false;
|
|
266
297
|
}
|
|
267
298
|
}
|
|
299
|
+
const packageSpec = phrenPackageSpec();
|
|
268
300
|
const content = isWindows
|
|
269
|
-
? `@echo off\r\nrem PHREN_CLI_WRAPPER — managed by phren init; safe to delete\r\nif not defined PHREN_PATH set "PHREN_PATH=${phrenPath}"\r\
|
|
301
|
+
? `@echo off\r\nrem PHREN_CLI_WRAPPER — managed by phren init; safe to delete\r\nif not defined PHREN_PATH set "PHREN_PATH=${phrenPath}"\r\nif exist "${entry}" (node "${entry}" %*) else (npx -y ${packageSpec} %*)\r\n`
|
|
270
302
|
: `#!/bin/sh
|
|
271
303
|
# PHREN_CLI_WRAPPER — managed by phren init; safe to delete
|
|
272
304
|
set -u
|
|
273
305
|
PHREN_PATH="\${PHREN_PATH:-${phrenPath}}"
|
|
274
306
|
export PHREN_PATH
|
|
275
|
-
|
|
307
|
+
if [ -f ${shellEscape(entry)} ]; then
|
|
308
|
+
exec node ${shellEscape(entry)} "$@"
|
|
309
|
+
else
|
|
310
|
+
exec npx -y ${packageSpec} "$@"
|
|
311
|
+
fi
|
|
276
312
|
`;
|
|
277
313
|
try {
|
|
278
314
|
fs.mkdirSync(localBinDir, { recursive: true });
|
|
@@ -6,6 +6,7 @@ import * as path from "path";
|
|
|
6
6
|
import { execFileSync, spawnSync } from "child_process";
|
|
7
7
|
import { atomicWriteText, debugLog, isRecord, hookConfigPath, homeDir, homePath, findPhrenPath, getProjectDirs, readRootManifest, } from "../shared.js";
|
|
8
8
|
import { errorMessage } from "../utils.js";
|
|
9
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
9
10
|
import { codexJsonCandidates, copilotMcpCandidates, cursorMcpCandidates, vscodeMcpCandidates, } from "../provider-adapters.js";
|
|
10
11
|
import { removeMcpServerAtPath, removeTomlMcpServer, isPhrenCommand, patchJsonFile, } from "./config.js";
|
|
11
12
|
import { DEFAULT_PHREN_PATH, log } from "./shared.js";
|
|
@@ -171,7 +172,7 @@ async function promptUninstallConfirm(phrenPath) {
|
|
|
171
172
|
const projectCount = projectDirs.length;
|
|
172
173
|
let findingCount = 0;
|
|
173
174
|
for (const dir of projectDirs) {
|
|
174
|
-
const findingsFile = path.join(dir,
|
|
175
|
+
const findingsFile = path.join(dir, FINDINGS_FILENAME);
|
|
175
176
|
if (fs.existsSync(findingsFile)) {
|
|
176
177
|
const content = fs.readFileSync(findingsFile, "utf8");
|
|
177
178
|
findingCount += content.split("\n").filter((l) => l.startsWith("- ")).length;
|
package/dist/init/setup.js
CHANGED
|
@@ -15,6 +15,7 @@ import { STOP_WORDS, errorMessage } from "../utils.js";
|
|
|
15
15
|
import { ROOT, STARTER_DIR, VERSION, resolveEntryScript, commandVersion, versionAtLeast, nearestWritableTarget } from "./shared.js";
|
|
16
16
|
import { readInstallPreferences } from "./preferences.js";
|
|
17
17
|
import { TASKS_FILENAME } from "../data/tasks.js";
|
|
18
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
18
19
|
import { getProjectOwnershipDefault, parseProjectOwnershipMode, readProjectConfig, writeProjectConfig, } from "../project-config.js";
|
|
19
20
|
import { getBuiltinTopicConfig, normalizeBuiltinTopicDomain } from "../project-topics.js";
|
|
20
21
|
import { writeSkillMd } from "../link/skills.js";
|
|
@@ -916,8 +917,8 @@ export function ensureProjectScaffold(projectDir, projectName, domain = "softwar
|
|
|
916
917
|
if (!fs.existsSync(path.join(projectDir, "topic-config.json"))) {
|
|
917
918
|
atomicWriteText(path.join(projectDir, "topic-config.json"), JSON.stringify({ version: 1, domain: normalizedDomain, topics: inferredTopics }, null, 2) + "\n");
|
|
918
919
|
}
|
|
919
|
-
if (!fs.existsSync(path.join(projectDir,
|
|
920
|
-
atomicWriteText(path.join(projectDir,
|
|
920
|
+
if (!fs.existsSync(path.join(projectDir, FINDINGS_FILENAME))) {
|
|
921
|
+
atomicWriteText(path.join(projectDir, FINDINGS_FILENAME), `# ${projectName} FINDINGS\n\n<!-- Findings are captured automatically during sessions and committed on exit -->\n`);
|
|
921
922
|
}
|
|
922
923
|
if (!fs.existsSync(path.join(projectDir, TASKS_FILENAME))) {
|
|
923
924
|
atomicWriteText(path.join(projectDir, TASKS_FILENAME), `# ${projectName} tasks\n\n## Active\n\n## Queue\n\n## Done\n`);
|
|
@@ -1062,8 +1063,8 @@ export function bootstrapFromExisting(phrenPath, projectPath, opts = {}) {
|
|
|
1062
1063
|
if (!fs.existsSync(summaryPath)) {
|
|
1063
1064
|
atomicWriteText(summaryPath, `# ${projectName}\n\n**What:** Bootstrapped from ${sourceRoot}\n${sourceInfo}\n\n${summaryLines.length > 1 ? summaryLines.slice(1).join("\n") : ""}\n`);
|
|
1064
1065
|
}
|
|
1065
|
-
if (!fs.existsSync(path.join(projDir,
|
|
1066
|
-
atomicWriteText(path.join(projDir,
|
|
1066
|
+
if (!fs.existsSync(path.join(projDir, FINDINGS_FILENAME))) {
|
|
1067
|
+
atomicWriteText(path.join(projDir, FINDINGS_FILENAME), `# ${projectName} FINDINGS\n\n<!-- Bootstrapped from ${sourceRoot} -->\n`);
|
|
1067
1068
|
}
|
|
1068
1069
|
if (!fs.existsSync(path.join(projDir, TASKS_FILENAME))) {
|
|
1069
1070
|
atomicWriteText(path.join(projDir, TASKS_FILENAME), `# ${projectName} tasks\n\n## Active\n\n## Queue\n\n## Done\n`);
|
package/dist/init-uninstall.js
CHANGED
|
@@ -11,6 +11,7 @@ import { errorMessage } from "./utils.js";
|
|
|
11
11
|
import { machineFilePath } from "./machine-identity.js";
|
|
12
12
|
import { codexJsonCandidates, copilotMcpCandidates, cursorMcpCandidates, vscodeMcpCandidates, } from "./provider-adapters.js";
|
|
13
13
|
import { DEFAULT_PHREN_PATH, log } from "./init/shared.js";
|
|
14
|
+
import { FINDINGS_FILENAME } from "./data/access.js";
|
|
14
15
|
const PHREN_NPM_PACKAGE_NAME = "@phren/cli";
|
|
15
16
|
function getNpmCommand() {
|
|
16
17
|
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
@@ -192,7 +193,7 @@ async function promptUninstallConfirm(phrenPath) {
|
|
|
192
193
|
const projectCount = projectDirs.length;
|
|
193
194
|
let findingCount = 0;
|
|
194
195
|
for (const dir of projectDirs) {
|
|
195
|
-
const findingsFile = path.join(dir,
|
|
196
|
+
const findingsFile = path.join(dir, FINDINGS_FILENAME);
|
|
196
197
|
if (fs.existsSync(findingsFile)) {
|
|
197
198
|
const content = fs.readFileSync(findingsFile, "utf8");
|
|
198
199
|
findingCount += content.split("\n").filter((l) => l.startsWith("- ")).length;
|
package/dist/link/checksums.js
CHANGED
|
@@ -3,6 +3,7 @@ import * as path from "path";
|
|
|
3
3
|
import * as crypto from "crypto";
|
|
4
4
|
import { getProjectDirs } from "../shared.js";
|
|
5
5
|
import { TASK_FILE_ALIASES } from "../data/tasks.js";
|
|
6
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
6
7
|
import { errorMessage } from "../utils.js";
|
|
7
8
|
import { logger } from "../logger.js";
|
|
8
9
|
function fileChecksum(filePath) {
|
|
@@ -35,7 +36,7 @@ export function updateFileChecksums(phrenPath, profileName) {
|
|
|
35
36
|
const tracked = [];
|
|
36
37
|
const dirs = getProjectDirs(phrenPath, profileName);
|
|
37
38
|
for (const dir of dirs) {
|
|
38
|
-
for (const name of [
|
|
39
|
+
for (const name of [FINDINGS_FILENAME, ...TASK_FILE_ALIASES, "truths.md"]) {
|
|
39
40
|
const full = path.join(dir, name);
|
|
40
41
|
if (!fs.existsSync(full))
|
|
41
42
|
continue;
|
package/dist/link/context.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as yaml from "js-yaml";
|
|
|
4
4
|
import { isValidProjectName } from "../utils.js";
|
|
5
5
|
import { homeDir, homePath } from "../shared.js";
|
|
6
6
|
import { resolveTaskFilePath } from "../data/tasks.js";
|
|
7
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
7
8
|
import { log } from "../init/shared.js";
|
|
8
9
|
function contextFilePath() {
|
|
9
10
|
return homePath(".phren-context.md");
|
|
@@ -88,7 +89,7 @@ export function writeContextDebugging(machine, profile, mcpStatus, projects, phr
|
|
|
88
89
|
for (const project of projects) {
|
|
89
90
|
if (project === "global")
|
|
90
91
|
continue;
|
|
91
|
-
const findings = path.join(phrenPath, project,
|
|
92
|
+
const findings = path.join(phrenPath, project, FINDINGS_FILENAME);
|
|
92
93
|
if (fs.existsSync(findings)) {
|
|
93
94
|
let body = fs.readFileSync(findings, "utf8");
|
|
94
95
|
if (body.length > MAX_FILE_BYTES) {
|
package/dist/link/doctor.js
CHANGED
|
@@ -13,6 +13,7 @@ import { verifyFileChecksums, updateFileChecksums } from "./checksums.js";
|
|
|
13
13
|
import { buildSkillManifest } from "../skill/registry.js";
|
|
14
14
|
import { inspectTaskHygiene } from "../task/hygiene.js";
|
|
15
15
|
import { resolveTaskFilePath, TASK_FILE_ALIASES } from "../data/tasks.js";
|
|
16
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
16
17
|
import { repairPreexistingInstall } from "../init/setup.js";
|
|
17
18
|
import { getMachineName, lookupProfile, findProfileFile, getProfileProjects, findProjectDir, } from "./link.js";
|
|
18
19
|
import { claudeProjectKey } from "./context.js";
|
|
@@ -240,7 +241,7 @@ export async function runDoctor(phrenPath, fix = false, checkData = false) {
|
|
|
240
241
|
checks.push({ name: `project-path:${project}`, ok: false, detail: "project directory not found on disk" });
|
|
241
242
|
continue;
|
|
242
243
|
}
|
|
243
|
-
for (const f of ["CLAUDE.md", "REFERENCE.md",
|
|
244
|
+
for (const f of ["CLAUDE.md", "REFERENCE.md", FINDINGS_FILENAME]) {
|
|
244
245
|
const src = path.join(phrenPath, project, f);
|
|
245
246
|
if (!fs.existsSync(src))
|
|
246
247
|
continue;
|
|
@@ -547,7 +548,7 @@ export async function runDoctor(phrenPath, fix = false, checkData = false) {
|
|
|
547
548
|
detail: hygiene.detail,
|
|
548
549
|
});
|
|
549
550
|
}
|
|
550
|
-
const findingsPath = path.join(projectDir,
|
|
551
|
+
const findingsPath = path.join(projectDir, FINDINGS_FILENAME);
|
|
551
552
|
if (fs.existsSync(findingsPath)) {
|
|
552
553
|
const content = fs.readFileSync(findingsPath, "utf8");
|
|
553
554
|
const issues = validateFindingsFormat(content);
|
|
@@ -563,7 +564,7 @@ export async function runDoctor(phrenPath, fix = false, checkData = false) {
|
|
|
563
564
|
const projectName = path.basename(projectDir);
|
|
564
565
|
if (projectName === "global")
|
|
565
566
|
continue;
|
|
566
|
-
for (const mdFile of [
|
|
567
|
+
for (const mdFile of [FINDINGS_FILENAME, ...TASK_FILE_ALIASES, "review.md", "CLAUDE.md", "REFERENCE.md"]) {
|
|
567
568
|
const filePath = path.join(projectDir, mdFile);
|
|
568
569
|
if (!fs.existsSync(filePath))
|
|
569
570
|
continue;
|
package/dist/link/link.js
CHANGED
|
@@ -9,6 +9,7 @@ import { configureAllHooks, detectInstalledTools } from "../hooks.js";
|
|
|
9
9
|
import { getMachineName, persistMachineName } from "../machine-identity.js";
|
|
10
10
|
import { debugLog, EXEC_TIMEOUT_MS, EXEC_TIMEOUT_QUICK_MS, isRecord, homePath, hookConfigPath, installPreferencesFile, atomicWriteText, } from "../shared.js";
|
|
11
11
|
import { errorMessage } from "../utils.js";
|
|
12
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
12
13
|
import { log } from "../init/shared.js";
|
|
13
14
|
import { listMachines as listMachinesShared, listProfiles as listProfilesShared, setMachineProfile, } from "../profile-store.js";
|
|
14
15
|
import { writeSkillMd, isManagedSymlink } from "./skills.js";
|
|
@@ -300,7 +301,7 @@ function linkProject(phrenPath, project, tools) {
|
|
|
300
301
|
return;
|
|
301
302
|
log(` ${project} -> ${target}`);
|
|
302
303
|
const excludeEntries = [];
|
|
303
|
-
for (const f of ["CLAUDE.md", "REFERENCE.md",
|
|
304
|
+
for (const f of ["CLAUDE.md", "REFERENCE.md", FINDINGS_FILENAME]) {
|
|
304
305
|
const src = path.join(phrenPath, project, f);
|
|
305
306
|
if (fs.existsSync(src)) {
|
|
306
307
|
if (symlinkFile(src, path.join(target, f), phrenPath))
|
package/dist/phren-paths.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as yaml from "js-yaml";
|
|
|
6
6
|
import { bootstrapPhrenDotEnv } from "./phren-dotenv.js";
|
|
7
7
|
import { PhrenError, isRecord, RESERVED_PROJECT_DIR_NAMES } from "./phren-core.js";
|
|
8
8
|
import { errorMessage, isValidProjectName, safeProjectPath } from "./utils.js";
|
|
9
|
+
import { FINDINGS_FILENAME } from "./data/access.js";
|
|
9
10
|
bootstrapPhrenDotEnv();
|
|
10
11
|
function stderrLog(msg) { try {
|
|
11
12
|
process.stderr.write("[phren] " + msg + "\n");
|
|
@@ -310,7 +311,7 @@ export function appendIndexEvent(phrenPath, event) {
|
|
|
310
311
|
}
|
|
311
312
|
/** Resolve the canonical findings file for a project directory. */
|
|
312
313
|
export function resolveFindingsPath(projectDir) {
|
|
313
|
-
const findingsPath = path.join(projectDir,
|
|
314
|
+
const findingsPath = path.join(projectDir, FINDINGS_FILENAME);
|
|
314
315
|
if (fs.existsSync(findingsPath))
|
|
315
316
|
return findingsPath;
|
|
316
317
|
return undefined;
|
|
@@ -484,7 +485,7 @@ export function computePhrenLiveStateToken(phrenPath) {
|
|
|
484
485
|
for (const projectDir of projectDirs) {
|
|
485
486
|
const project = path.basename(projectDir);
|
|
486
487
|
parts.push(`project:${project}`);
|
|
487
|
-
for (const file of ["CLAUDE.md", "summary.md",
|
|
488
|
+
for (const file of ["CLAUDE.md", "summary.md", FINDINGS_FILENAME, "tasks.md", "review.md", "truths.md", "topic-config.json", "phren.project.yaml"]) {
|
|
488
489
|
pushFileToken(parts, path.join(projectDir, file));
|
|
489
490
|
}
|
|
490
491
|
pushDirTokens(parts, path.join(projectDir, "reference"));
|
package/dist/profile-store.d.ts
CHANGED
package/dist/profile-store.js
CHANGED
|
@@ -6,8 +6,10 @@ import { phrenErr, PhrenError, phrenOk, forwardErr, getProjectDirs, readRootMani
|
|
|
6
6
|
import { defaultMachineName, getMachineName } from "./machine-identity.js";
|
|
7
7
|
import { errorMessage, isValidProjectName } from "./utils.js";
|
|
8
8
|
import { TASK_FILE_ALIASES } from "./data/tasks.js";
|
|
9
|
+
import { FINDINGS_FILENAME } from "./data/access.js";
|
|
9
10
|
import { withSafeLock } from "./shared/data-utils.js";
|
|
10
11
|
import { logger } from "./logger.js";
|
|
12
|
+
import { VALID_FINDING_SENSITIVITY, VALID_PROACTIVITY_LEVELS, VALID_TASK_MODES, VALID_RISKY_SECTIONS, } from "./governance/policy.js";
|
|
11
13
|
import { getNonPrimaryStores, getStoreProjectDirs } from "./store-registry.js";
|
|
12
14
|
export function resolveActiveProfile(phrenPath, requestedProfile) {
|
|
13
15
|
const manifest = readRootManifest(phrenPath);
|
|
@@ -108,10 +110,6 @@ export function setMachineProfile(phrenPath, machine, profile) {
|
|
|
108
110
|
return phrenOk(`Mapped machine ${machine} -> ${profile}.`);
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
|
-
const VALID_FINDING_SENSITIVITY_VALS = ["minimal", "conservative", "balanced", "aggressive"];
|
|
112
|
-
const VALID_PROACTIVITY_VALS = ["high", "medium", "low"];
|
|
113
|
-
const VALID_TASK_MODE_VALS = ["off", "manual", "suggest", "auto"];
|
|
114
|
-
const VALID_RISKY_SECTION_VALS = ["Review", "Stale", "Conflicts"];
|
|
115
113
|
function pickEnumVal(value, allowed) {
|
|
116
114
|
return typeof value === "string" && allowed.includes(value) ? value : undefined;
|
|
117
115
|
}
|
|
@@ -132,19 +130,19 @@ function parseProfilePolicyDefaults(raw) {
|
|
|
132
130
|
? data.workflowPolicy
|
|
133
131
|
: undefined;
|
|
134
132
|
const result = {};
|
|
135
|
-
const fs_ = pickEnumVal(data.findingSensitivity,
|
|
133
|
+
const fs_ = pickEnumVal(data.findingSensitivity, VALID_FINDING_SENSITIVITY);
|
|
136
134
|
if (fs_)
|
|
137
135
|
result.findingSensitivity = fs_;
|
|
138
|
-
const pr = pickEnumVal(data.proactivity,
|
|
136
|
+
const pr = pickEnumVal(data.proactivity, VALID_PROACTIVITY_LEVELS);
|
|
139
137
|
if (pr)
|
|
140
138
|
result.proactivity = pr;
|
|
141
|
-
const prf = pickEnumVal(data.proactivityFindings,
|
|
139
|
+
const prf = pickEnumVal(data.proactivityFindings, VALID_PROACTIVITY_LEVELS);
|
|
142
140
|
if (prf)
|
|
143
141
|
result.proactivityFindings = prf;
|
|
144
|
-
const prt = pickEnumVal(data.proactivityTask,
|
|
142
|
+
const prt = pickEnumVal(data.proactivityTask, VALID_PROACTIVITY_LEVELS);
|
|
145
143
|
if (prt)
|
|
146
144
|
result.proactivityTask = prt;
|
|
147
|
-
const tm = pickEnumVal(data.taskMode,
|
|
145
|
+
const tm = pickEnumVal(data.taskMode, VALID_TASK_MODES);
|
|
148
146
|
if (tm)
|
|
149
147
|
result.taskMode = tm;
|
|
150
148
|
if (retentionRaw) {
|
|
@@ -188,7 +186,7 @@ function parseProfilePolicyDefaults(raw) {
|
|
|
188
186
|
wf.lowConfidenceThreshold = lct;
|
|
189
187
|
if (Array.isArray(workflowRaw.riskySections)) {
|
|
190
188
|
const rs = workflowRaw.riskySections
|
|
191
|
-
.filter((s) => typeof s === "string" &&
|
|
189
|
+
.filter((s) => typeof s === "string" && VALID_RISKY_SECTIONS.includes(s));
|
|
192
190
|
if (rs.length > 0)
|
|
193
191
|
wf.riskySections = rs;
|
|
194
192
|
}
|
|
@@ -226,8 +224,9 @@ export function listProfiles(phrenPath) {
|
|
|
226
224
|
const projects = Array.isArray(data?.projects)
|
|
227
225
|
? data.projects.map((project) => String(project)).filter(Boolean)
|
|
228
226
|
: [];
|
|
227
|
+
const description = typeof data?.description === "string" ? data.description : undefined;
|
|
229
228
|
const defaults = parseProfilePolicyDefaults(data?.defaults);
|
|
230
|
-
profiles.push({ name, file: full, projects, ...(defaults ? { defaults } : {}) });
|
|
229
|
+
profiles.push({ name, ...(description ? { description } : {}), file: full, projects, ...(defaults ? { defaults } : {}) });
|
|
231
230
|
}
|
|
232
231
|
catch (err) {
|
|
233
232
|
logger.debug("profile-store", `listProfiles yamlParse: ${errorMessage(err)}`);
|
|
@@ -236,12 +235,12 @@ export function listProfiles(phrenPath) {
|
|
|
236
235
|
}
|
|
237
236
|
return phrenOk(profiles);
|
|
238
237
|
}
|
|
239
|
-
function writeProfile(file, name, projects) {
|
|
238
|
+
function writeProfile(file, name, projects, description) {
|
|
240
239
|
const backup = `${file}.bak`;
|
|
241
240
|
if (fs.existsSync(file))
|
|
242
241
|
fs.copyFileSync(file, backup);
|
|
243
242
|
const normalized = [...new Set(projects)].sort();
|
|
244
|
-
const out = yaml.dump({ name, projects: normalized }, { lineWidth: 1000 });
|
|
243
|
+
const out = yaml.dump({ name, ...(description ? { description } : {}), projects: normalized }, { lineWidth: 1000 });
|
|
245
244
|
const tmpPath = `${file}.tmp-${crypto.randomUUID()}`;
|
|
246
245
|
fs.writeFileSync(tmpPath, out);
|
|
247
246
|
fs.renameSync(tmpPath, file);
|
|
@@ -263,7 +262,7 @@ export function addProjectToProfile(phrenPath, profile, project) {
|
|
|
263
262
|
if (!latest)
|
|
264
263
|
return phrenErr(`Profile "${profile}" not found.`, PhrenError.NOT_FOUND);
|
|
265
264
|
const projects = latest.projects.includes(project) ? latest.projects : [...latest.projects, project];
|
|
266
|
-
writeProfile(latest.file, latest.name, projects);
|
|
265
|
+
writeProfile(latest.file, latest.name, projects, latest.description);
|
|
267
266
|
return phrenOk(`Added ${project} to profile ${profile}.`);
|
|
268
267
|
});
|
|
269
268
|
}
|
|
@@ -282,7 +281,7 @@ export function removeProjectFromProfile(phrenPath, profile, project) {
|
|
|
282
281
|
if (!latest)
|
|
283
282
|
return phrenErr(`Profile "${profile}" not found.`, PhrenError.NOT_FOUND);
|
|
284
283
|
const projects = latest.projects.filter((entry) => entry !== project);
|
|
285
|
-
writeProfile(latest.file, latest.name, projects);
|
|
284
|
+
writeProfile(latest.file, latest.name, projects, latest.description);
|
|
286
285
|
return phrenOk(`Removed ${project} from profile ${profile}.`);
|
|
287
286
|
});
|
|
288
287
|
}
|
|
@@ -299,7 +298,7 @@ function buildProjectCard(dir) {
|
|
|
299
298
|
.split("\n")
|
|
300
299
|
.map((line) => line.trim())
|
|
301
300
|
.find((line) => line && !line.startsWith("#")) || "";
|
|
302
|
-
const docs = ["CLAUDE.md",
|
|
301
|
+
const docs = ["CLAUDE.md", FINDINGS_FILENAME, "summary.md", "review.md"]
|
|
303
302
|
.filter((file) => fs.existsSync(path.join(dir, file)));
|
|
304
303
|
const taskFile = TASK_FILE_ALIASES.find((file) => fs.existsSync(path.join(dir, file)));
|
|
305
304
|
if (taskFile)
|
package/dist/project-topics.js
CHANGED
|
@@ -5,6 +5,7 @@ import { debugLog } from "./shared.js";
|
|
|
5
5
|
import { withFileLock } from "./shared/governance.js";
|
|
6
6
|
import { STOP_WORDS, errorMessage, extractKeywords, isValidProjectName, safeProjectPath } from "./utils.js";
|
|
7
7
|
import { walkDirectory } from "./shared/data-utils.js";
|
|
8
|
+
import { FINDINGS_FILENAME } from "./data/access.js";
|
|
8
9
|
const TOPIC_CONFIG_FILENAME = "topic-config.json";
|
|
9
10
|
const AUTO_TOPIC_MARKER_RE = /^<!--\s*phren:auto-topic(?:\s+slug=([a-z0-9_-]+))?\s*-->$/;
|
|
10
11
|
const ARCHIVED_SECTION_RE = /^## Archived (\d{4}-\d{2}-\d{2})$/;
|
|
@@ -410,7 +411,7 @@ function countByTerm(terms) {
|
|
|
410
411
|
}
|
|
411
412
|
function readTopicInputContent(phrenPath, project) {
|
|
412
413
|
const parts = [];
|
|
413
|
-
for (const file of ["CLAUDE.md",
|
|
414
|
+
for (const file of ["CLAUDE.md", FINDINGS_FILENAME]) {
|
|
414
415
|
const filePath = safeProjectPath(phrenPath, project, file);
|
|
415
416
|
if (!filePath || !fs.existsSync(filePath))
|
|
416
417
|
continue;
|
|
@@ -896,12 +897,12 @@ function tokenizeSuggestionTerms(text) {
|
|
|
896
897
|
}
|
|
897
898
|
function collectSuggestionCorpus(phrenPath, project) {
|
|
898
899
|
const parts = [];
|
|
899
|
-
for (const file of ["CLAUDE.md", "summary.md",
|
|
900
|
+
for (const file of ["CLAUDE.md", "summary.md", FINDINGS_FILENAME]) {
|
|
900
901
|
const filePath = safeProjectPath(phrenPath, project, file);
|
|
901
902
|
if (!filePath || !fs.existsSync(filePath))
|
|
902
903
|
continue;
|
|
903
904
|
const content = fs.readFileSync(filePath, "utf8");
|
|
904
|
-
if (file ===
|
|
905
|
+
if (file === FINDINGS_FILENAME) {
|
|
905
906
|
const recentBullets = content.split("\n").filter((line) => line.startsWith("- ")).slice(-10).join("\n");
|
|
906
907
|
parts.push(recentBullets);
|
|
907
908
|
continue;
|
package/dist/shell/input.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { execFileSync } from "child_process";
|
|
6
6
|
import * as fs from "fs";
|
|
7
7
|
import * as path from "path";
|
|
8
|
-
import { addTask, addFinding, addProjectToProfile, completeTask, listProjectCards, pinTask, readTasks, readFindings, readReviewQueue, removeFinding, removeProjectFromProfile, resetShellState, saveShellState, setMachineProfile, tidyDoneTasks, canonicalTaskFilePath, unpinTask, updateTask, workNextTask, loadShellState, resolveTaskFilePath, } from "../data/access.js";
|
|
8
|
+
import { addTask, addFinding, addProjectToProfile, completeTask, listProjectCards, pinTask, readTasks, readFindings, readReviewQueue, removeFinding, removeProjectFromProfile, resetShellState, saveShellState, setMachineProfile, tidyDoneTasks, canonicalTaskFilePath, unpinTask, updateTask, workNextTask, loadShellState, resolveTaskFilePath, FINDINGS_FILENAME, } from "../data/access.js";
|
|
9
9
|
import { runtimeFile } from "../shared.js";
|
|
10
10
|
import { handleGovernMemories } from "../cli/govern.js";
|
|
11
11
|
import { runSearch } from "../cli/search.js";
|
|
@@ -266,7 +266,7 @@ export async function executePalette(host, input) {
|
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
268
|
host.confirmThen(`Remove finding "${match}"?`, () => {
|
|
269
|
-
const file = path.join(host.phrenPath, project,
|
|
269
|
+
const file = path.join(host.phrenPath, project, FINDINGS_FILENAME);
|
|
270
270
|
host.snapshotForUndo(`find remove "${match}"`, file);
|
|
271
271
|
host.setMessage(` ${resultMsg(removeFinding(host.phrenPath, project, match))}`);
|
|
272
272
|
});
|
|
@@ -673,7 +673,7 @@ async function doViewAction(host, key) {
|
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
675
|
host.confirmThen(`Delete finding ${style.dim(item.id ?? "")}?`, () => {
|
|
676
|
-
const file = path.join(host.phrenPath, project,
|
|
676
|
+
const file = path.join(host.phrenPath, project, FINDINGS_FILENAME);
|
|
677
677
|
host.snapshotForUndo(`remove finding ${item.id ?? ''}`, file);
|
|
678
678
|
const r = removeFinding(host.phrenPath, project, item.text);
|
|
679
679
|
host.setMessage(` ${resultMsg(r)}`);
|
package/dist/status.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getMcpEnabledPreference, getHooksEnabledPreference } from "./init/init.
|
|
|
8
8
|
import { getTelemetrySummary } from "./telemetry.js";
|
|
9
9
|
import { runGit as runGitShared, errorMessage } from "./utils.js";
|
|
10
10
|
import { logger } from "./logger.js";
|
|
11
|
-
import { readRuntimeHealth, resolveTaskFilePath } from "./data/access.js";
|
|
11
|
+
import { readRuntimeHealth, resolveTaskFilePath, FINDINGS_FILENAME } from "./data/access.js";
|
|
12
12
|
import { resolveRuntimeProfile } from "./runtime-profile.js";
|
|
13
13
|
import { renderPhrenArt } from "./phren-art.js";
|
|
14
14
|
import { RESET, BOLD, DIM, GREEN, YELLOW, RED, CYAN } from "./shell/render.js";
|
|
@@ -318,7 +318,7 @@ export async function runStatus() {
|
|
|
318
318
|
let totalQueue = 0;
|
|
319
319
|
for (const dir of projectDirs) {
|
|
320
320
|
const projName = path.basename(dir);
|
|
321
|
-
totalFindings += countBullets(path.join(phrenPath, projName,
|
|
321
|
+
totalFindings += countBullets(path.join(phrenPath, projName, FINDINGS_FILENAME));
|
|
322
322
|
const taskPath = resolveTaskFilePath(phrenPath, projName);
|
|
323
323
|
if (taskPath)
|
|
324
324
|
totalTask += countBullets(taskPath);
|