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

@ -59,6 +59,16 @@ describe("brain consolidate CLI (SC5)", () => {
assert.equal(diff.additions.length, 1);
});
test("--propose writes pending-diff.md in OKF-compatible form (type: PendingDiff)", () => {
// The pending-diff is a transient operator-review artifact that lives in the
// brain/ bundle, so it must carry a type or okf-check fails the whole bundle
// mid-propose. (docs/okf-convergence-brief.md Stage-1 deferred item.)
runCli(root, ["consolidate", "--propose", "--candidates", candidatesFile(root, [validCand])]);
const block = readFileSync(pendingMd(root), "utf8").match(/^---\n([\s\S]*?)\n---\n/);
assert.ok(block, "pending-diff.md leads with a frontmatter block");
assert.match(block![1], /^type:\s*PendingDiff\s*$/m, "pending-diff.md is type PendingDiff");
});
test("--propose REJECTS a malformed candidate (missing field), no write", () => {
const { code } = runCli(root, ["consolidate", "--propose", "--candidates", candidatesFile(root, [{ key: "x", value: "y" }])]);
assert.notEqual(code, 0, "non-zero exit on malformed candidate");