phewsh 0.15.51 → 0.15.52

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 — split into manual and generated sections later by parser
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
- const cursorrules = path.join(cwd, '.cursorrules');
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,11 +59,16 @@ 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
- for (const chunk of byKind.state) {
66
- sections.push(embedChunk(chunk));
67
+ const body = embedChunk(byKind.state[0]).split('\n').filter(l => l.trim());
68
+ sections.push(body.slice(0, 8).join('\n'));
69
+ if (body.length > 8 || byKind.state.length > 1) {
70
+ sections.push('');
71
+ sections.push('_Full state & history: `.intent/status.md` · run `phewsh status`._');
67
72
  }
68
73
  sections.push('');
69
74
  }
@@ -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 =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phewsh",
3
- "version": "0.15.51",
3
+ "version": "0.15.52",
4
4
  "description": "Turn intent into action. Structure your thinking, execute your next step.",
5
5
  "bin": {
6
6
  "phewsh": "bin/phewsh.js"