@productbrain/cli 0.1.0-beta.11500 → 0.1.0-beta.11506
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/__tests__/adapters.test.js +3 -3
- package/dist/__tests__/adapters.test.js.map +1 -1
- package/dist/__tests__/session-close-conversation.test.js +0 -1
- package/dist/__tests__/session-close-conversation.test.js.map +1 -1
- package/dist/__tests__/session-close-loop.test.js +0 -1
- package/dist/__tests__/session-close-loop.test.js.map +1 -1
- package/dist/__tests__/session-list-show.test.js +0 -1
- package/dist/__tests__/session-list-show.test.js.map +1 -1
- package/dist/__tests__/session-resume-backstop.test.js +0 -1
- package/dist/__tests__/session-resume-backstop.test.js.map +1 -1
- package/dist/__tests__/session-role-name-sanitize.test.js +0 -1
- package/dist/__tests__/session-role-name-sanitize.test.js.map +1 -1
- package/dist/__tests__/session-switch.test.js +0 -1
- package/dist/__tests__/session-switch.test.js.map +1 -1
- package/dist/__tests__/session.test.js +0 -3
- package/dist/__tests__/session.test.js.map +1 -1
- package/dist/commands/orient.js +1 -1
- package/dist/commands/orient.js.map +1 -1
- package/dist/commands/scoreboard.d.ts +2 -5
- package/dist/commands/scoreboard.d.ts.map +1 -1
- package/dist/commands/scoreboard.js +3 -8
- package/dist/commands/scoreboard.js.map +1 -1
- package/dist/formatters/__tests__/orient-plannedWorkCut.test.js +1 -9
- package/dist/formatters/__tests__/orient-plannedWorkCut.test.js.map +1 -1
- package/dist/formatters/scoreboard.d.ts.map +1 -1
- package/dist/formatters/scoreboard.js +0 -1
- package/dist/formatters/scoreboard.js.map +1 -1
- package/dist/formatters/scoreboard.test.js +2 -3
- package/dist/formatters/scoreboard.test.js.map +1 -1
- package/dist/generators/adapters.d.ts +3 -3
- package/dist/generators/adapters.d.ts.map +1 -1
- package/dist/generators/adapters.js +8 -11
- package/dist/generators/adapters.js.map +1 -1
- package/dist/generators/adapters.test.js +2 -1
- package/dist/generators/adapters.test.js.map +1 -1
- package/dist/generators/briefing-projections.test.js +5 -30
- package/dist/generators/briefing-projections.test.js.map +1 -1
- package/dist/generators/region.d.ts +1 -1
- package/dist/generators/region.d.ts.map +1 -1
- package/dist/generators/region.js +4 -4
- package/dist/generators/region.js.map +1 -1
- package/dist/lib/productbrain-files.js +5 -5
- package/dist/lib/productbrain-files.js.map +1 -1
- package/dist/lib/projectConfig.d.ts +2 -2
- package/dist/lib/projectConfig.js +2 -2
- package/dist/lib/ruleListRender.d.ts +2 -2
- package/dist/lib/ruleListRender.js +2 -2
- package/dist/lib/sessionNotices.d.ts.map +1 -1
- package/dist/lib/sessionNotices.js +0 -4
- package/dist/lib/sessionNotices.js.map +1 -1
- package/dist/lib/workspaceVocabCache.d.ts +2 -2
- package/dist/lib/workspaceVocabCache.js +2 -2
- package/dist/lib/writePerimeter.d.ts +2 -2
- package/dist/lib/writePerimeter.js +2 -2
- package/dist/scoreboard/diagnose.d.ts +3 -33
- package/dist/scoreboard/diagnose.d.ts.map +1 -1
- package/dist/scoreboard/diagnose.js +10 -137
- package/dist/scoreboard/diagnose.js.map +1 -1
- package/dist/scoreboard/diagnose.test.d.ts +2 -2
- package/dist/scoreboard/diagnose.test.js +5 -102
- package/dist/scoreboard/diagnose.test.js.map +1 -1
- package/dist/scoreboard/floors.d.ts +3 -8
- package/dist/scoreboard/floors.d.ts.map +1 -1
- package/dist/scoreboard/floors.js +0 -17
- package/dist/scoreboard/floors.js.map +1 -1
- package/dist/served-doors.test.d.ts +2 -0
- package/dist/served-doors.test.d.ts.map +1 -0
- package/dist/served-doors.test.js +186 -0
- package/dist/served-doors.test.js.map +1 -0
- package/dist/surfaces/adapters/claude.js +2 -2
- package/package.json +1 -1
- package/dist/commands/handshakeCursorSkillCleanup.d.ts +0 -36
- package/dist/commands/handshakeCursorSkillCleanup.d.ts.map +0 -1
- package/dist/commands/handshakeCursorSkillCleanup.js +0 -110
- package/dist/commands/handshakeCursorSkillCleanup.js.map +0 -1
- package/dist/commands/handshakeDriftClassification.d.ts +0 -33
- package/dist/commands/handshakeDriftClassification.d.ts.map +0 -1
- package/dist/commands/handshakeDriftClassification.js +0 -62
- package/dist/commands/handshakeDriftClassification.js.map +0 -1
- package/dist/formatters/handshake.d.ts +0 -80
- package/dist/formatters/handshake.d.ts.map +0 -1
- package/dist/formatters/handshake.js +0 -217
- package/dist/formatters/handshake.js.map +0 -1
- package/dist/generators/briefing-md.d.ts +0 -8
- package/dist/generators/briefing-md.d.ts.map +0 -1
- package/dist/generators/briefing-md.js +0 -51
- package/dist/generators/briefing-md.js.map +0 -1
- package/dist/generators/context-md.d.ts +0 -13
- package/dist/generators/context-md.d.ts.map +0 -1
- package/dist/generators/context-md.js +0 -95
- package/dist/generators/context-md.js.map +0 -1
- package/dist/generators/everyone-rules-md.d.ts +0 -9
- package/dist/generators/everyone-rules-md.d.ts.map +0 -1
- package/dist/generators/everyone-rules-md.js +0 -21
- package/dist/generators/everyone-rules-md.js.map +0 -1
- package/dist/generators/retired-projections.d.ts +0 -12
- package/dist/generators/retired-projections.d.ts.map +0 -1
- package/dist/generators/retired-projections.js +0 -75
- package/dist/generators/retired-projections.js.map +0 -1
- package/dist/generators/retired-projections.test.d.ts +0 -2
- package/dist/generators/retired-projections.test.d.ts.map +0 -1
- package/dist/generators/retired-projections.test.js +0 -64
- package/dist/generators/retired-projections.test.js.map +0 -1
- package/dist/scoreboard/localDrift.d.ts +0 -23
- package/dist/scoreboard/localDrift.d.ts.map +0 -1
- package/dist/scoreboard/localDrift.js +0 -111
- package/dist/scoreboard/localDrift.js.map +0 -1
- package/dist/scoreboard/localDrift.test.d.ts +0 -9
- package/dist/scoreboard/localDrift.test.d.ts.map +0 -1
- package/dist/scoreboard/localDrift.test.js +0 -82
- package/dist/scoreboard/localDrift.test.js.map +0 -1
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handshake formatter — console report after file generation.
|
|
3
|
-
*/
|
|
4
|
-
import type { SearchResult } from './search.js';
|
|
5
|
-
import type { RepoContext } from '../lib/repo-detect.js';
|
|
6
|
-
import type { CodexValidationWarning } from '../generators/portable-knowledge.js';
|
|
7
|
-
export type PreviewStatus = 'would-write' | 'would-update' | 'unchanged' | 'user-owned' | 'filtered' | 'would-augment' | 'needs-attention';
|
|
8
|
-
export interface HandshakeReport {
|
|
9
|
-
filesWritten: string[];
|
|
10
|
-
filesSkipped: Array<{
|
|
11
|
-
path: string;
|
|
12
|
-
reason: string;
|
|
13
|
-
}>;
|
|
14
|
-
matchedEntries: SearchResult[];
|
|
15
|
-
searchQueries: string[];
|
|
16
|
-
repo: RepoContext;
|
|
17
|
-
codexWarnings?: CodexValidationWarning[];
|
|
18
|
-
/** Rules that passed the adopted allowlist filter (when manifest.yaml present). */
|
|
19
|
-
adoptedCount?: number;
|
|
20
|
-
/** Rules excluded by the rejected denylist (when manifest.yaml present). */
|
|
21
|
-
rejectedCount?: number;
|
|
22
|
-
/** Number of personal rules loaded from .productbrain/.local/rules/ (local only, never committed). */
|
|
23
|
-
personalRuleCount?: number;
|
|
24
|
-
/** Number of personal skills loaded from .productbrain/.local/skills/ (local only, never committed). */
|
|
25
|
-
personalSkillCount?: number;
|
|
26
|
-
/** Source the method registry was loaded from (present when manifest is set). */
|
|
27
|
-
/** Always 'bundled' — the Chain registry path was removed (TEN-2783). */
|
|
28
|
-
registrySource?: 'bundled';
|
|
29
|
-
/** true when registrySource is 'bundled' and the snapshot is older than 7 days. */
|
|
30
|
-
registryStale?: boolean;
|
|
31
|
-
/** true when running in preview mode (no files written — run with --apply to write). */
|
|
32
|
-
preview?: boolean;
|
|
33
|
-
/** Structured plan for preview mode output. */
|
|
34
|
-
previewPlan?: Array<{
|
|
35
|
-
path: string;
|
|
36
|
-
status: PreviewStatus;
|
|
37
|
-
}>;
|
|
38
|
-
/**
|
|
39
|
-
* Adapter paths that are user-owned (exist without the auto-gen MARKER) — handshake
|
|
40
|
-
* left them untouched. Relayed to the connect screen so it does not falsely report
|
|
41
|
-
* them as synced (TEN-2107). NEVER treated as drift: no warning, no TEN (TEN-2150).
|
|
42
|
-
*/
|
|
43
|
-
userOwnedSkipped?: string[];
|
|
44
|
-
/** Count of PB-managed files whose marker + embedded hash trailer matched the body (clean). */
|
|
45
|
-
managedCleanCount?: number;
|
|
46
|
-
/** Tampered files refused in headless mode — present only in the headless refusal report. */
|
|
47
|
-
tamperedFiles?: Array<{
|
|
48
|
-
path: string;
|
|
49
|
-
expectedHash: string;
|
|
50
|
-
actualHash: string;
|
|
51
|
-
}>;
|
|
52
|
-
/** Tampered projection paths the user chose to ADOPT (captured as personal-scoped drafts). */
|
|
53
|
-
adoptedTamperedPaths?: string[];
|
|
54
|
-
/** Tampered projection paths the user chose to REVERT (overwritten with canonical content). */
|
|
55
|
-
revertedTamperedPaths?: string[];
|
|
56
|
-
/**
|
|
57
|
-
* REPORT-ONLY (coordinator ruling, PR #912 round 10): marker-bearing projection files that
|
|
58
|
-
* look stale — orphaned, a stale case/punctuation variant, or a leftover `.dormant` copy.
|
|
59
|
-
* `pb handshake` never unlinks, renames, or recreates any of these; the human removes them.
|
|
60
|
-
*/
|
|
61
|
-
leftoverFiles?: Array<{
|
|
62
|
-
path: string;
|
|
63
|
-
reason: string;
|
|
64
|
-
}>;
|
|
65
|
-
/** Round 13: true when the scanner stopped early (LEFTOVER_FILES_MAX) — the exact total beyond
|
|
66
|
-
* what's shown is unknown by design (round 12 stops enumerating, it doesn't keep counting). */
|
|
67
|
-
leftoverFilesTruncated?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* REPORT-ONLY (WP-759/TASK-234, DEC-1736): rules/skills whose `targets` frontmatter names only
|
|
70
|
-
* surfaces that no longer project that asset kind (today: `claude` alone, since the rule/skill
|
|
71
|
-
* router projection was deleted). pb handshake does not re-target or drop these — the asset
|
|
72
|
-
* silently projects nowhere until a human re-targets it in Cortex.
|
|
73
|
-
*/
|
|
74
|
-
noProjectionAssets?: Array<{
|
|
75
|
-
name: string;
|
|
76
|
-
targets: string[];
|
|
77
|
-
}>;
|
|
78
|
-
}
|
|
79
|
-
export declare function formatHandshakeReport(report: HandshakeReport): string;
|
|
80
|
-
//# sourceMappingURL=handshake.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/formatters/handshake.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAGlF,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE3I,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACzC,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sGAAsG;IACtG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wGAAwG;IACxG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iFAAiF;IACjF,yEAAyE;IACzE,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IAC7D;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6FAA6F;IAC7F,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClF,8FAA8F;IAC9F,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,+FAA+F;IAC/F,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD;oGACgG;IAChG,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CACjE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CA+NrE"}
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handshake formatter — console report after file generation.
|
|
3
|
-
*/
|
|
4
|
-
import { renderFilesystemPath } from '../lib/strip.js';
|
|
5
|
-
export function formatHandshakeReport(report) {
|
|
6
|
-
const lines = [];
|
|
7
|
-
const name = report.repo.name ?? 'unknown';
|
|
8
|
-
const slug = report.repo.repoSlug ? ` (${report.repo.repoSlug})` : '';
|
|
9
|
-
if (report.preview && report.previewPlan) {
|
|
10
|
-
// Preview mode output
|
|
11
|
-
lines.push('pb handshake — preview (run with --apply to write)');
|
|
12
|
-
lines.push('');
|
|
13
|
-
lines.push(`Repo: ${name}${slug}`);
|
|
14
|
-
if (report.repo.detectedStack.length > 0) {
|
|
15
|
-
lines.push(`Stack: ${report.repo.detectedStack.join(', ')}`);
|
|
16
|
-
}
|
|
17
|
-
lines.push('');
|
|
18
|
-
lines.push('Plan:');
|
|
19
|
-
const statusSymbol = {
|
|
20
|
-
'would-write': '+',
|
|
21
|
-
'would-update': '↑',
|
|
22
|
-
'unchanged': '✓',
|
|
23
|
-
'user-owned': '○',
|
|
24
|
-
'filtered': '·',
|
|
25
|
-
'would-augment': '✚',
|
|
26
|
-
'needs-attention': '⚠',
|
|
27
|
-
};
|
|
28
|
-
const statusLabel = {
|
|
29
|
-
'would-write': 'would write',
|
|
30
|
-
'would-update': 'would update',
|
|
31
|
-
'unchanged': 'unchanged',
|
|
32
|
-
'user-owned': 'user-owned — left untouched (pb won\'t overwrite your file)',
|
|
33
|
-
'filtered': 'filtered by surface',
|
|
34
|
-
'would-augment': 'would augment — add a PB region; your content untouched',
|
|
35
|
-
'needs-attention': 'malformed PB region — left untouched; fix the pb:region sentinels',
|
|
36
|
-
};
|
|
37
|
-
for (const item of report.previewPlan) {
|
|
38
|
-
lines.push(` ${statusSymbol[item.status]} ${item.path} (${statusLabel[item.status]})`);
|
|
39
|
-
}
|
|
40
|
-
const wouldWrite = report.previewPlan.filter((i) => i.status === 'would-write' || i.status === 'would-update').length;
|
|
41
|
-
const unchanged = report.previewPlan.filter((i) => i.status === 'unchanged').length;
|
|
42
|
-
const userOwned = report.previewPlan.filter((i) => i.status === 'user-owned').length;
|
|
43
|
-
const filtered = report.previewPlan.filter((i) => i.status === 'filtered').length;
|
|
44
|
-
const wouldAugment = report.previewPlan.filter((i) => i.status === 'would-augment').length;
|
|
45
|
-
const needsAttention = report.previewPlan.filter((i) => i.status === 'needs-attention').length;
|
|
46
|
-
const summary = [];
|
|
47
|
-
if (wouldWrite > 0)
|
|
48
|
-
summary.push(`${wouldWrite} would write`);
|
|
49
|
-
if (unchanged > 0)
|
|
50
|
-
summary.push(`${unchanged} unchanged`);
|
|
51
|
-
if (userOwned > 0)
|
|
52
|
-
summary.push(`${userOwned} user-owned`);
|
|
53
|
-
if (filtered > 0)
|
|
54
|
-
summary.push(`${filtered} filtered`);
|
|
55
|
-
if (wouldAugment > 0)
|
|
56
|
-
summary.push(`${wouldAugment} would augment`);
|
|
57
|
-
if (needsAttention > 0)
|
|
58
|
-
summary.push(`${needsAttention} need attention`);
|
|
59
|
-
lines.push('');
|
|
60
|
-
lines.push(` ${summary.join(', ')}`);
|
|
61
|
-
lines.push('');
|
|
62
|
-
lines.push('Run `pb handshake --apply` to write these files.');
|
|
63
|
-
return lines.join('\n');
|
|
64
|
-
}
|
|
65
|
-
// Apply / dry-run mode output (existing format)
|
|
66
|
-
lines.push('pb handshake — context files generated');
|
|
67
|
-
lines.push('');
|
|
68
|
-
// Repo info
|
|
69
|
-
lines.push(`Repo: ${name}${slug}`);
|
|
70
|
-
if (report.repo.detectedStack.length > 0) {
|
|
71
|
-
lines.push(`Stack: ${report.repo.detectedStack.join(', ')}`);
|
|
72
|
-
}
|
|
73
|
-
lines.push('');
|
|
74
|
-
// Written files
|
|
75
|
-
if (report.filesWritten.length > 0) {
|
|
76
|
-
lines.push('Written:');
|
|
77
|
-
for (const f of report.filesWritten) {
|
|
78
|
-
lines.push(` ${f}`);
|
|
79
|
-
}
|
|
80
|
-
lines.push('');
|
|
81
|
-
}
|
|
82
|
-
// Skipped files
|
|
83
|
-
if (report.filesSkipped.length > 0) {
|
|
84
|
-
lines.push('Skipped:');
|
|
85
|
-
for (const f of report.filesSkipped) {
|
|
86
|
-
lines.push(` ${f.path} — ${f.reason}`);
|
|
87
|
-
}
|
|
88
|
-
lines.push('');
|
|
89
|
-
}
|
|
90
|
-
// Matched entries
|
|
91
|
-
if (report.matchedEntries.length > 0) {
|
|
92
|
-
lines.push(`Matched ${report.matchedEntries.length} Chain entries:`);
|
|
93
|
-
for (const e of report.matchedEntries.slice(0, 20)) {
|
|
94
|
-
const id = e.entryId ?? e.name;
|
|
95
|
-
const coll = e.collectionSlug ?? '—';
|
|
96
|
-
lines.push(` ${id} [${coll}] ${e.name}`);
|
|
97
|
-
}
|
|
98
|
-
if (report.matchedEntries.length > 20) {
|
|
99
|
-
lines.push(` ... and ${report.matchedEntries.length - 20} more`);
|
|
100
|
-
}
|
|
101
|
-
lines.push('');
|
|
102
|
-
}
|
|
103
|
-
// Codex dead-reference warnings
|
|
104
|
-
if (report.codexWarnings && report.codexWarnings.length > 0) {
|
|
105
|
-
lines.push(`Codex warnings (${report.codexWarnings.length} dead reference(s) in projected skills):`);
|
|
106
|
-
for (const w of report.codexWarnings) {
|
|
107
|
-
lines.push(` ${w.skillName}: ${w.pattern} — "${w.line}"`);
|
|
108
|
-
}
|
|
109
|
-
lines.push(' (These references may not work in Codex. Consider transport sections or targets.)');
|
|
110
|
-
lines.push('');
|
|
111
|
-
}
|
|
112
|
-
// Manifest adoption counts
|
|
113
|
-
if (report.adoptedCount !== undefined || report.rejectedCount !== undefined) {
|
|
114
|
-
const parts = [];
|
|
115
|
-
if (report.adoptedCount !== undefined)
|
|
116
|
-
parts.push(`${report.adoptedCount} adopted`);
|
|
117
|
-
if (report.rejectedCount !== undefined)
|
|
118
|
-
parts.push(`${report.rejectedCount} rejected`);
|
|
119
|
-
if (parts.length > 0) {
|
|
120
|
-
lines.push(`Manifest filter: ${parts.join(', ')}`);
|
|
121
|
-
lines.push('');
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
// Personal layer
|
|
125
|
-
const personalItems = [];
|
|
126
|
-
if (report.personalRuleCount !== undefined && report.personalRuleCount > 0) {
|
|
127
|
-
personalItems.push(`${report.personalRuleCount} rule(s)`);
|
|
128
|
-
}
|
|
129
|
-
if (report.personalSkillCount !== undefined && report.personalSkillCount > 0) {
|
|
130
|
-
personalItems.push(`${report.personalSkillCount} skill(s)`);
|
|
131
|
-
}
|
|
132
|
-
if (personalItems.length > 0) {
|
|
133
|
-
lines.push(`Personal layer (local only): ${personalItems.join(', ')}`);
|
|
134
|
-
lines.push('');
|
|
135
|
-
}
|
|
136
|
-
// Method registry (bundled-only since TEN-2783). The registry ships INSIDE the pb CLI package
|
|
137
|
-
// (templates/method-registry.json), so the only way to refresh it is to update the CLI — NOT
|
|
138
|
-
// `pb handshake`, which just re-reads the same bundled snapshot (that guidance was a dead-end
|
|
139
|
-
// left over from the removed Chain path). The staleness signal is kept as an "your CLI is old"
|
|
140
|
-
// nudge, now pointing at the real refresh path.
|
|
141
|
-
if (report.registrySource !== undefined) {
|
|
142
|
-
if (report.registryStale) {
|
|
143
|
-
lines.push('⚠ Method registry: bundled snapshot >7 days old — update the pb CLI to refresh (it ships with the package)');
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
lines.push('✓ Method registry: bundled');
|
|
147
|
-
}
|
|
148
|
-
lines.push('');
|
|
149
|
-
}
|
|
150
|
-
// User-owned files (no auto-gen MARKER) are left untouched and already appear
|
|
151
|
-
// under "Skipped:" above. They are NOT drift: handshake never wrote them, so
|
|
152
|
-
// there is nothing to "sync" and no draft TEN is logged (TEN-2150). Relayed to
|
|
153
|
-
// the connect screen via report.userOwnedSkipped, not surfaced as a warning here.
|
|
154
|
-
// ── WP-421 S3 (doneWhen #17): drift report ────────────────────────────────
|
|
155
|
-
// Drift concerns PB-managed files only: PB-managed-clean / PB-managed-tampered
|
|
156
|
-
// (refused or resolved). user-owned files are benign skips (left untouched) and
|
|
157
|
-
// are NEVER drift — so they are not a bucket in this report (TEN-2150); they
|
|
158
|
-
// already appear under "Skipped:" above.
|
|
159
|
-
const cleanCount = report.managedCleanCount ?? 0;
|
|
160
|
-
const tamperedCount = (report.tamperedFiles?.length ?? 0)
|
|
161
|
-
+ (report.adoptedTamperedPaths?.length ?? 0)
|
|
162
|
-
+ (report.revertedTamperedPaths?.length ?? 0);
|
|
163
|
-
if (cleanCount > 0 || tamperedCount > 0) {
|
|
164
|
-
lines.push('Drift report (2 buckets):');
|
|
165
|
-
lines.push(` PB-managed-clean: ${cleanCount}`);
|
|
166
|
-
lines.push(` PB-managed-tampered: ${tamperedCount}`);
|
|
167
|
-
if (report.tamperedFiles && report.tamperedFiles.length > 0) {
|
|
168
|
-
lines.push(' Tampered (refused — headless mode):');
|
|
169
|
-
for (const t of report.tamperedFiles) {
|
|
170
|
-
lines.push(` ${t.path} (expected ${t.expectedHash}, actual ${t.actualHash})`);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (report.adoptedTamperedPaths && report.adoptedTamperedPaths.length > 0) {
|
|
174
|
-
lines.push(' Tampered (adopted as personal-scoped drafts):');
|
|
175
|
-
for (const p of report.adoptedTamperedPaths)
|
|
176
|
-
lines.push(` ${p}`);
|
|
177
|
-
}
|
|
178
|
-
if (report.revertedTamperedPaths && report.revertedTamperedPaths.length > 0) {
|
|
179
|
-
lines.push(' Tampered (reverted to canonical):');
|
|
180
|
-
for (const p of report.revertedTamperedPaths)
|
|
181
|
-
lines.push(` ${p}`);
|
|
182
|
-
}
|
|
183
|
-
lines.push('');
|
|
184
|
-
}
|
|
185
|
-
// REPORT-ONLY (coordinator ruling, PR #912 round 10) — pb handshake never unlinks, renames, or
|
|
186
|
-
// recreates any of these; the human removes them.
|
|
187
|
-
if (report.leftoverFiles && report.leftoverFiles.length > 0) {
|
|
188
|
-
lines.push('Leftover files:');
|
|
189
|
-
for (const f of report.leftoverFiles) {
|
|
190
|
-
// Round 15 (Codex P2): f.path is a readdirSync-derived filesystem name a user is told to
|
|
191
|
-
// go find and remove — sanitizeSingleLineField is lossy (collapses whitespace, deletes
|
|
192
|
-
// \r) for that use, so this uses the reversible filesystem-identifier escaper instead
|
|
193
|
-
// (lib/strip.ts), the one owner of this rule for all three leftover-render sites.
|
|
194
|
-
lines.push(` ${renderFilesystemPath(f.path)} — ${renderFilesystemPath(f.reason)}`);
|
|
195
|
-
}
|
|
196
|
-
if (report.leftoverFilesTruncated) {
|
|
197
|
-
// Round 13 (Codex P2): don't promise this same, equally-capped command shows "the full
|
|
198
|
-
// list" — it never will in one run. Tell the user what to do with what's actually shown.
|
|
199
|
-
lines.push(' ...more may exist beyond this batch — review/remove these, then run `pb handshake` again.');
|
|
200
|
-
}
|
|
201
|
-
lines.push('');
|
|
202
|
-
}
|
|
203
|
-
// REPORT-ONLY (WP-759/TASK-234, DEC-1736) — pb handshake never re-targets these; the human
|
|
204
|
-
// re-targets them in Cortex.
|
|
205
|
-
if (report.noProjectionAssets && report.noProjectionAssets.length > 0) {
|
|
206
|
-
for (const a of report.noProjectionAssets) {
|
|
207
|
-
lines.push(`${a.name}: targets [${a.targets.join(', ')}] have no projection since DEC-1736; re-target in Cortex`);
|
|
208
|
-
}
|
|
209
|
-
lines.push('');
|
|
210
|
-
}
|
|
211
|
-
lines.push('Tip: Add .productbrain/ to .gitignore (contains workspace-specific context).');
|
|
212
|
-
lines.push(' Adapter files are local-only — never commit them. Regenerate on demand with `pb handshake --apply`.');
|
|
213
|
-
lines.push('');
|
|
214
|
-
lines.push('Run `pb handshake` again to refresh.');
|
|
215
|
-
return lines.join('\n');
|
|
216
|
-
}
|
|
217
|
-
//# sourceMappingURL=handshake.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../src/formatters/handshake.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AA6DvD,MAAM,UAAU,qBAAqB,CAAC,MAAuB;IAC3D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC;IAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,C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,CAAC;AAC1B,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates .productbrain/briefing.md — entries matched to this specific repo.
|
|
3
|
-
* Pure function: search results + repo context in, markdown string out.
|
|
4
|
-
*/
|
|
5
|
-
import type { SearchResult } from '../formatters/search.js';
|
|
6
|
-
import type { RepoContext } from '../lib/repo-detect.js';
|
|
7
|
-
export declare function generateBriefingMd(entries: SearchResult[], repo: RepoContext, searchQueries: string[], timestamp: string): string;
|
|
8
|
-
//# sourceMappingURL=briefing-md.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"briefing-md.d.ts","sourceRoot":"","sources":["../../src/generators/briefing-md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EAAE,EACvB,IAAI,EAAE,WAAW,EACjB,aAAa,EAAE,MAAM,EAAE,EACvB,SAAS,EAAE,MAAM,GAChB,MAAM,CAiDR"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates .productbrain/briefing.md — entries matched to this specific repo.
|
|
3
|
-
* Pure function: search results + repo context in, markdown string out.
|
|
4
|
-
*/
|
|
5
|
-
export function generateBriefingMd(entries, repo, searchQueries, timestamp) {
|
|
6
|
-
const lines = [];
|
|
7
|
-
lines.push('<!-- auto-generated by pb handshake — ' + timestamp + ' -->');
|
|
8
|
-
lines.push('<!-- Re-run `pb handshake` to refresh. Do not edit manually. -->');
|
|
9
|
-
lines.push('');
|
|
10
|
-
lines.push(`# Repo Briefing — ${repo.name ?? 'Unknown'}`);
|
|
11
|
-
lines.push('');
|
|
12
|
-
lines.push(`_Generated: ${timestamp}_`);
|
|
13
|
-
if (repo.repoSlug)
|
|
14
|
-
lines.push(`_Repo: ${repo.repoSlug}_`);
|
|
15
|
-
if (repo.detectedStack.length > 0)
|
|
16
|
-
lines.push(`_Stack: ${repo.detectedStack.join(', ')}_`);
|
|
17
|
-
lines.push('');
|
|
18
|
-
if (entries.length === 0) {
|
|
19
|
-
lines.push('No matching Chain entries found for this repository.');
|
|
20
|
-
lines.push('');
|
|
21
|
-
lines.push(`Searched for: ${searchQueries.join(', ')}`);
|
|
22
|
-
lines.push('');
|
|
23
|
-
lines.push('Try `pb search <query>` for manual searches.');
|
|
24
|
-
lines.push('');
|
|
25
|
-
return lines.join('\n');
|
|
26
|
-
}
|
|
27
|
-
lines.push(`**${entries.length}** entries found relevant to this repository.`);
|
|
28
|
-
lines.push('');
|
|
29
|
-
// Group by collection
|
|
30
|
-
const grouped = new Map();
|
|
31
|
-
for (const e of entries) {
|
|
32
|
-
const coll = e.collectionSlug ?? 'other';
|
|
33
|
-
if (!grouped.has(coll))
|
|
34
|
-
grouped.set(coll, []);
|
|
35
|
-
grouped.get(coll).push(e);
|
|
36
|
-
}
|
|
37
|
-
for (const [coll, items] of grouped) {
|
|
38
|
-
lines.push(`## ${coll} (${items.length})`);
|
|
39
|
-
for (const e of items) {
|
|
40
|
-
const id = e.entryId ?? e.name;
|
|
41
|
-
lines.push(`- **${id}** — ${e.name}${e.status ? ` [${e.status}]` : ''}`);
|
|
42
|
-
}
|
|
43
|
-
lines.push('');
|
|
44
|
-
}
|
|
45
|
-
lines.push('---');
|
|
46
|
-
lines.push(`_Searched for: ${searchQueries.join(', ')}_`);
|
|
47
|
-
lines.push('_Run `pb get <ID>` for full details on any entry._');
|
|
48
|
-
lines.push('');
|
|
49
|
-
return lines.join('\n');
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=briefing-md.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"briefing-md.js","sourceRoot":"","sources":["../../src/generators/briefing-md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAK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,CAAC,CAAC;IACjE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates .productbrain/context.md — workspace briefing snapshot.
|
|
3
|
-
* Pure function: orient view and the workspace briefing lines in, markdown string out.
|
|
4
|
-
*
|
|
5
|
-
* TASK-554 (WP-777, DEC-1888): the briefing (spine and the Everyone rule list, each rule one
|
|
6
|
-
* sentence with its why) comes from the one kernel builder (`formatWorkspaceBriefingLines`), the
|
|
7
|
-
* same lines everyone-rules.md and chain.mdc carry. This file is shared by every session in the
|
|
8
|
-
* worktree, so team and role lists never enter it; session start and orient serve those.
|
|
9
|
-
*/
|
|
10
|
-
import type { OrientViewFromApi } from '../commands/orient.js';
|
|
11
|
-
import type { RepoContext } from '../lib/repo-detect.js';
|
|
12
|
-
export declare function generateContextMd(view: OrientViewFromApi, briefingLines: string[], repo: RepoContext, timestamp: string): string;
|
|
13
|
-
//# sourceMappingURL=context-md.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-md.d.ts","sourceRoot":"","sources":["../../src/generators/context-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAWzD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CA+EhI"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates .productbrain/context.md — workspace briefing snapshot.
|
|
3
|
-
* Pure function: orient view and the workspace briefing lines in, markdown string out.
|
|
4
|
-
*
|
|
5
|
-
* TASK-554 (WP-777, DEC-1888): the briefing (spine and the Everyone rule list, each rule one
|
|
6
|
-
* sentence with its why) comes from the one kernel builder (`formatWorkspaceBriefingLines`), the
|
|
7
|
-
* same lines everyone-rules.md and chain.mdc carry. This file is shared by every session in the
|
|
8
|
-
* worktree, so team and role lists never enter it; session start and orient serve those.
|
|
9
|
-
*/
|
|
10
|
-
import { cutNote } from '../formatters/plannedWorkCounts.js'; // TEN-4562
|
|
11
|
-
function entryLine(e, maxPreview = 100) {
|
|
12
|
-
const id = e.entryId ?? e.name;
|
|
13
|
-
if (e.preview) {
|
|
14
|
-
const p = e.preview.length > maxPreview ? e.preview.slice(0, maxPreview) + '...' : e.preview;
|
|
15
|
-
return `- **${id}** — ${p}`;
|
|
16
|
-
}
|
|
17
|
-
return `- **${id}** — ${e.name}`;
|
|
18
|
-
}
|
|
19
|
-
export function generateContextMd(view, briefingLines, repo, timestamp) {
|
|
20
|
-
const lines = [];
|
|
21
|
-
lines.push('<!-- auto-generated by pb handshake — ' + timestamp + ' -->');
|
|
22
|
-
lines.push('<!-- Re-run `pb handshake` to refresh. Do not edit manually. -->');
|
|
23
|
-
lines.push('');
|
|
24
|
-
lines.push('# Product Brain — Workspace Context');
|
|
25
|
-
lines.push('');
|
|
26
|
-
lines.push(`_Generated: ${timestamp}_`);
|
|
27
|
-
if (repo.name)
|
|
28
|
-
lines.push(`_Repo: ${repo.name}${repo.repoSlug ? ` (${repo.repoSlug})` : ''}_`);
|
|
29
|
-
lines.push('');
|
|
30
|
-
lines.push('## Briefing');
|
|
31
|
-
lines.push(...briefingLines);
|
|
32
|
-
lines.push('');
|
|
33
|
-
const sc = view.strategicContext;
|
|
34
|
-
lines.push('## Strategic Context');
|
|
35
|
-
lines.push(`- **Active work packages**: ${sc.activeWorkPackageCount}`);
|
|
36
|
-
lines.push(`- **Active tensions**: ${sc.activeTensionCount}`);
|
|
37
|
-
lines.push('');
|
|
38
|
-
// Active work packages
|
|
39
|
-
if (view.activeWorkPackages.length > 0) {
|
|
40
|
-
lines.push('## Active Work Packages');
|
|
41
|
-
for (const bet of view.activeWorkPackages.slice(0, 10)) {
|
|
42
|
-
lines.push(`- **${bet.entryId ?? bet.name}** — ${bet.name}`);
|
|
43
|
-
if (bet.linkedTensions && bet.linkedTensions.length > 0) {
|
|
44
|
-
for (const t of bet.linkedTensions.slice(0, 3)) {
|
|
45
|
-
lines.push(` - ${t.name}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
lines.push('');
|
|
50
|
-
}
|
|
51
|
-
// Architecture notes
|
|
52
|
-
if (view.architectureNotes && view.architectureNotes.length > 0) {
|
|
53
|
-
lines.push('## Architecture');
|
|
54
|
-
for (const a of view.architectureNotes.slice(0, 5))
|
|
55
|
-
lines.push(entryLine(a));
|
|
56
|
-
lines.push('');
|
|
57
|
-
}
|
|
58
|
-
// Open tensions
|
|
59
|
-
if (view.tensions && view.tensions.length > 0) {
|
|
60
|
-
lines.push('## Open Tensions');
|
|
61
|
-
for (const t of view.tensions.slice(0, 10)) {
|
|
62
|
-
lines.push(`- **${t.entryId ?? t.name}** — ${t.name}`);
|
|
63
|
-
}
|
|
64
|
-
lines.push('');
|
|
65
|
-
}
|
|
66
|
-
// Planned work
|
|
67
|
-
const pw = view.plannedWork;
|
|
68
|
-
if (pw) {
|
|
69
|
-
const hasPlanned = pw.uncommittedDrafts.length > 0 || pw.inProgressEntries.length > 0 || pw.openTensions.length > 0;
|
|
70
|
-
if (hasPlanned) {
|
|
71
|
-
lines.push('## Planned Work');
|
|
72
|
-
if (pw.uncommittedDrafts.length > 0) {
|
|
73
|
-
lines.push(`### Drafts${cutNote(pw.uncommittedDrafts.length, pw.draftsTruncated)}`);
|
|
74
|
-
for (const d of pw.uncommittedDrafts.slice(0, 5))
|
|
75
|
-
lines.push(`- ${d.name} [${d.collection}]`);
|
|
76
|
-
}
|
|
77
|
-
if (pw.inProgressEntries.length > 0) {
|
|
78
|
-
lines.push(`### In Progress${cutNote(pw.inProgressEntries.length, pw.inProgressTruncated)}`);
|
|
79
|
-
for (const e of pw.inProgressEntries.slice(0, 5))
|
|
80
|
-
lines.push(`- ${e.name} [${e.collection}]`);
|
|
81
|
-
}
|
|
82
|
-
if (pw.openTensions.length > 0) {
|
|
83
|
-
lines.push(`### Open Tensions${cutNote(pw.openTensions.length, pw.openTensionsTruncated)}`);
|
|
84
|
-
for (const t of pw.openTensions.slice(0, 5))
|
|
85
|
-
lines.push(`- ${t.name}`);
|
|
86
|
-
}
|
|
87
|
-
lines.push('');
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
lines.push('---');
|
|
91
|
-
lines.push('_This is a snapshot. Run `pb orient` for live data. Run `pb get <ID>` for full entry details._');
|
|
92
|
-
lines.push('');
|
|
93
|
-
return lines.join('\n');
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=context-md.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-md.js","sourceRoot":"","sources":["../../src/generators/context-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC,CAAC,WAAW;AAGzE,SAAS,SAAS,CAAC,CAA6D,EAAE,UAAU,GAAG,GAAG;IAChG,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC;IAC/B,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC7F,OAAO,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,OAAO,EAAE,QAAQ,CAAC,CAAC,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7F,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;YAChG,CAAC;YACD,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/B,KAAK,CAAC,IAAI,CAAC,oBAAoB,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;gBAC5F,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACzE,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,gGAAgG,CAAC,CAAC;IAC7G,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates .productbrain/generated/everyone-rules.md — the workspace briefing every session in a
|
|
3
|
-
* worktree shares: the spine and the Everyone rule list, each rule one sentence with its why
|
|
4
|
-
* (TASK-554, WP-777, DEC-1888). The lines come from the one kernel briefing builder
|
|
5
|
-
* (`formatWorkspaceBriefingLines`), the same lines context.md and chain.mdc carry.
|
|
6
|
-
* Pure function: rendered lines in, markdown string out.
|
|
7
|
-
*/
|
|
8
|
-
export declare function generateEveryoneRulesMd(briefingLines: string[], timestamp: string): string;
|
|
9
|
-
//# sourceMappingURL=everyone-rules-md.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"everyone-rules-md.d.ts","sourceRoot":"","sources":["../../src/generators/everyone-rules-md.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAY1F"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates .productbrain/generated/everyone-rules.md — the workspace briefing every session in a
|
|
3
|
-
* worktree shares: the spine and the Everyone rule list, each rule one sentence with its why
|
|
4
|
-
* (TASK-554, WP-777, DEC-1888). The lines come from the one kernel briefing builder
|
|
5
|
-
* (`formatWorkspaceBriefingLines`), the same lines context.md and chain.mdc carry.
|
|
6
|
-
* Pure function: rendered lines in, markdown string out.
|
|
7
|
-
*/
|
|
8
|
-
export function generateEveryoneRulesMd(briefingLines, timestamp) {
|
|
9
|
-
return [
|
|
10
|
-
'<!-- auto-generated by pb handshake — ' + timestamp + ' -->',
|
|
11
|
-
'<!-- Re-run `pb handshake` to refresh. Do not edit manually. -->',
|
|
12
|
-
'',
|
|
13
|
-
'# Everyone Rules',
|
|
14
|
-
'',
|
|
15
|
-
`_Generated: ${timestamp}_`,
|
|
16
|
-
'',
|
|
17
|
-
...briefingLines,
|
|
18
|
-
'',
|
|
19
|
-
].join('\n');
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=everyone-rules-md.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"everyone-rules-md.js","sourceRoot":"","sources":["../../src/generators/everyone-rules-md.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,uBAAuB,CAAC,aAAuB,EAAE,SAAiB;IAChF,OAAO;QACL,wCAAwC,GAAG,SAAS,GAAG,MAAM;QAC7D,kEAAkE;QAClE,EAAE;QACF,kBAAkB;QAClB,EAAE;QACF,eAAe,SAAS,GAAG;QAC3B,EAAE;QACF,GAAG,aAAa;QAChB,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Removes the retired generated rule files and state file; returns the relative paths removed. */
|
|
2
|
-
export declare function removeRetiredChainRuleProjections(cwd: string): string[];
|
|
3
|
-
/**
|
|
4
|
-
* Removes the two briefing projections, `.productbrain/context.md` and
|
|
5
|
-
* `.productbrain/generated/everyone-rules.md`, when the workspace briefing could not be fetched
|
|
6
|
-
* this run, so an old briefing is never left on disk as if it were current (TASK-554). Only files
|
|
7
|
-
* carrying the handshake MARKER are removed. Returns the relative paths removed.
|
|
8
|
-
*/
|
|
9
|
-
export declare function removeStaleBriefingProjections(cwd: string): string[];
|
|
10
|
-
/** Handshake's cleanup step (apply mode with a writing materialize mode): removes the retired generated files. */
|
|
11
|
-
export declare function retireGeneratedProjections(cwd: string, log: (msg: string) => void): void;
|
|
12
|
-
//# sourceMappingURL=retired-projections.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retired-projections.d.ts","sourceRoot":"","sources":["../../src/generators/retired-projections.ts"],"names":[],"mappings":"AA2CA,mGAAmG;AACnG,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAWvE;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAKpE;AAED,kHAAkH;AAClH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAGxF"}
|