feat(linkedin-studio): brain Stage 1 finish — title/description + pending-diff typed [skip-docs]

Completes the linkedin-studio in-scope Stage 1 (docs/okf-convergence-brief.md):
- serializeProfile + operations.md seed gain the cheap recommended OKF fields
  `title` + `description` (timestamp/resource intentionally omitted — a timestamp
  would break the pure/deterministic serializer; resource is N/A internally).
- renderDiffMd leads the transient pending-diff.md with `type: PendingDiff`, so
  the brain/ bundle passes okf-check even mid-propose.

Verified: 2 new tests (okf-conform + consolidate-cli); full brain suite 134/134
(0 regressions); cross-tool — okr/scripts/okf-check.mjs validates brain/ exit 0
WITH a pending-diff present.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmzxpsFpc8q19LaogAWLD
This commit is contained in:
Kjell Tore Guttormsen 2026-06-26 21:02:26 +02:00
commit e9e183ebb0
5 changed files with 28 additions and 1 deletions

View file

@ -96,6 +96,19 @@ describe("brain/ bundle is OKF-compatible form (Stage 1)", () => {
assert.equal(frontmatterType(text), "Operations");
});
test("concept files carry the cheap recommended fields (title + description)", () => {
// OKF recommends title/description; they are free (constant) here and give a
// foreign agent a human label without a clock (timestamp/resource stay out —
// a timestamp would break the pure serializer; resource is N/A for an internal
// concept). okf-check still only REQUIRES type; these clear its warnings.
for (const sub of ["brain/profile.md", "brain/operations.md"]) {
const block = readFileSync(join(root, sub), "utf8").match(/^---\n([\s\S]*?)\n---\n/);
assert.ok(block, `${sub} has a frontmatter block`);
assert.match(block![1], /^title:\s*\S/m, `${sub} has a title`);
assert.match(block![1], /^description:\s*\S/m, `${sub} has a description`);
}
});
test("each directory level under brain/ has its own index.md (progressive disclosure)", () => {
assert.ok(existsSync(join(root, "brain/index.md")), "brain/index.md");
assert.ok(existsSync(join(root, "brain/journal/index.md")), "brain/journal/index.md");