phewsh 0.15.51 → 0.15.53
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.
|
@@ -42,7 +42,8 @@ function discover(cwd = process.cwd(), home = os.homedir()) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// CLAUDE.md —
|
|
45
|
+
// CLAUDE.md — the claude-md parser strips phewsh's generated block, so only
|
|
46
|
+
// the user's MANUAL content is ingested (safe, no recursion).
|
|
46
47
|
const claudeMd = path.join(cwd, 'CLAUDE.md');
|
|
47
48
|
if (fs.existsSync(claudeMd)) {
|
|
48
49
|
add({ path: claudeMd, type: 'claude-md', name: 'CLAUDE.md', scope: 'project' });
|
|
@@ -79,25 +80,8 @@ function discover(cwd = process.cwd(), home = os.homedir()) {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
// .cursorrules
|
|
83
|
-
|
|
84
|
-
if (fs.existsSync(cursorrules)) {
|
|
85
|
-
add({ path: cursorrules, type: 'cursor', name: '.cursorrules', scope: 'project' });
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// agent.md / AGENTS.md (Codex / generic agent instructions, project scope)
|
|
89
|
-
for (const name of ['agent.md', 'AGENTS.md']) {
|
|
90
|
-
const p = path.join(cwd, name);
|
|
91
|
-
if (fs.existsSync(p)) {
|
|
92
|
-
add({ path: p, type: 'agent', name, scope: 'project' });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// GEMINI.md (project scope)
|
|
97
|
-
const geminiMd = path.join(cwd, 'GEMINI.md');
|
|
98
|
-
if (fs.existsSync(geminiMd)) {
|
|
99
|
-
add({ path: geminiMd, type: 'agent', name: 'GEMINI.md', scope: 'project' });
|
|
100
|
-
}
|
|
83
|
+
// (.cursorrules / AGENTS.md / GEMINI.md intentionally NOT read as sources —
|
|
84
|
+
// see note above: they are phewsh-managed outputs, not source truth.)
|
|
101
85
|
|
|
102
86
|
// soul.md
|
|
103
87
|
const soulMd = path.join(cwd, 'soul.md');
|
|
@@ -59,12 +59,20 @@ function emit(chunks, options = {}) {
|
|
|
59
59
|
sections.push('');
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
// 3. State — what's happening now
|
|
62
|
+
// 3. State — what's happening now. LEAN: the latest entry only, capped — the
|
|
63
|
+
// full log lives in .intent/status.md. Architecture over prose: this block
|
|
64
|
+
// points at the source of truth, it does not become the source of truth.
|
|
63
65
|
if (byKind.state?.length > 0) {
|
|
64
66
|
sections.push('## Current State');
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
// Prefer the curated "## Now" section (North Star / Current Focus / Open
|
|
68
|
+
// Decisions) over the changelog: emit up to the first horizontal rule that
|
|
69
|
+
// separates it from the history, with a safety cap when there's no divider.
|
|
70
|
+
const lines = embedChunk(byKind.state[0]).split('\n');
|
|
71
|
+
let cut = lines.findIndex(l => /^---+\s*$/.test(l));
|
|
72
|
+
if (cut < 0 || cut > 16) cut = 16;
|
|
73
|
+
sections.push(lines.slice(0, cut).filter(l => l.trim()).join('\n'));
|
|
74
|
+
sections.push('');
|
|
75
|
+
sections.push('_Full state & history: `.intent/status.md` · run `phewsh status`._');
|
|
68
76
|
sections.push('');
|
|
69
77
|
}
|
|
70
78
|
|
package/lib/sequencer/index.js
CHANGED
|
@@ -59,6 +59,14 @@ function sequence(options = {}) {
|
|
|
59
59
|
sources = sources.filter(s => s.scope !== 'global');
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
// A file's generated block must not restate the file's own manual content —
|
|
63
|
+
// that's circular (parallel truth). When emitting the claude-md block, drop
|
|
64
|
+
// the project CLAUDE.md source itself. The block carries .intent/-derived
|
|
65
|
+
// state and points at the source of truth; it does not echo the host file.
|
|
66
|
+
if (target === 'claude-md') {
|
|
67
|
+
sources = sources.filter(s => s.type !== 'claude-md');
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
// Filter sources if requested
|
|
63
71
|
if (sourceFilter && sourceFilter.length > 0) {
|
|
64
72
|
sources = sources.filter(s =>
|