From 16c3ebde0633fb0c8b4c4a043f6cba9297d37a97 Mon Sep 17 00:00:00 2001 From: Ian Pascoe Date: Mon, 25 May 2026 07:23:38 -0400 Subject: [PATCH 1/4] fix: remove console logs from native integrations --- .brv/.gitignore | 4 ++ .../rlm_curation_run_requirements.md | 33 +++++++++-------- .../facts/project/console_logging_policy.md | 37 +++++++++++++++++++ packages/cli/src/index.ts | 3 +- packages/core/src/engine.ts | 2 +- packages/core/src/native.ts | 5 ++- packages/core/src/native/process-cleanup.ts | 15 +++++++- packages/core/src/native/remote.ts | 6 +-- packages/core/src/native/service.ts | 2 +- packages/core/test/package-boundaries.test.ts | 19 ++++++++++ packages/pi/src/index.ts | 2 +- packages/pi/test/pi.test.ts | 30 +++++++-------- 12 files changed, 112 insertions(+), 46 deletions(-) create mode 100644 .brv/context-tree/facts/project/console_logging_policy.md diff --git a/.brv/.gitignore b/.brv/.gitignore index 8025f5b..f476665 100644 --- a/.brv/.gitignore +++ b/.brv/.gitignore @@ -27,6 +27,10 @@ _index.md + + + + # Review backups # Generated files diff --git a/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md b/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md index cc15141..dcb5062 100644 --- a/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md +++ b/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md @@ -1,18 +1,18 @@ --- title: RLM Curation Run Requirements -summary: RLM curation runs use pre-computed single-pass recon for small contexts, require mapExtract timeout at the tool-call level when used, and verify through applied file paths. +summary: RLM curation run requirements covering single-pass handling, context safety, verification, and curation workflow expectations. tags: [] related: [facts/conventions/rlm_curation_single_pass_mode.md, facts/conventions/rlm_curation_run_conventions.md, facts/conventions/context.md] keywords: [] createdAt: '2026-05-25T10:03:04.676Z' -updatedAt: '2026-05-25T10:19:24.663Z' +updatedAt: '2026-05-25T11:23:15.737Z' --- ## Reason -Capture explicit curation-run instructions and verification constraints from the provided context. +Curate single-pass RLM curation requirements and conventions from the provided context ## Raw Concept **Task:** -Document the required RLM curation run procedure for this session +Document the RLM curation run requirements and execution conventions for this single-pass curation context. **Changes:** - Use recon-suggested single-pass mode for small contexts @@ -25,11 +25,14 @@ Document the required RLM curation run procedure for this session - Recorded pre-computed recon usage for single-pass mode - Recorded timeout requirement for mapExtract tool calls - Recorded verification rule using applied file paths +- Recorded the precomputed recon result and single-pass recommendation +- Captured the requirement to avoid printing raw context +- Captured verification guidance using applied file paths **Flow:** -precomputed recon -> single-pass extraction -> curate -> verify applied file paths +precomputed recon -> single-pass curation -> curate UPSERT -> verify applied file paths -> report status -**Timestamp:** 2026-05-25T10:19:14.056Z +**Timestamp:** 2026-05-25T11:23:05.351Z **Author:** ByteRover context engineer @@ -38,21 +41,19 @@ precomputed recon -> single-pass extraction -> curate -> verify applied file pat ## Narrative ### Structure -This knowledge captures the run-level instructions governing how the current curation task must be processed. +This knowledge covers how to handle an RLM curation run when the context is small enough for a single-pass operation. ### Dependencies -Depends on the pre-computed recon result and the provided context/history/metadata variables. +Depends on the precomputed recon result, the provided context/history/metadata variables, and the curation API. ### Highlights -Single-pass mode is already suggested; mapExtract is only relevant for chunked extraction, and if used it requires a 300000 ms timeout at the code_exec call level. +Single-pass mode was recommended. The instructions emphasize not printing raw context, not re-running recon, and verifying success from applied file paths. ### Rules -IMPORTANT: Do NOT print raw context. Do NOT call tools.curation.recon — it has been pre-computed. Proceed directly to extraction. -IMPORTANT: Any code_exec call containing mapExtract MUST use timeout: 300000 on the code_exec tool call itself (not inside mapExtract options). -Verify via result.applied[].filePath — do NOT call readFile for verification. +Do NOT print raw context. Do NOT call tools.curation.recon. Proceed directly to extraction. Verify via result.applied[].filePath. ## Facts -- **rlm_curation_mode**: Curation runs must use the RLM approach with pre-computed recon in single-pass mode for small contexts. [convention] -- **mapextract_timeout**: When mapExtract is used, the code_exec call containing it must use timeout 300000 at the tool-call level. [convention] -- **verification_method**: Verification must use result.applied[].filePath and must not call readFile for verification. [convention] -- **curation_context_size**: The context payload for this curation run is small: 1307 chars, 26 lines, and 0 messages. [project] +- **curation_mode**: The context is small enough for single-pass curation. [convention] +- **recon_status**: Recon was already computed before curation and suggested single-pass mode. [convention] +- **context_logging_policy**: The curation workflow must not print raw context. [convention] +- **verification_method**: Verification must use result.applied[].filePath and not readFile. [convention] diff --git a/.brv/context-tree/facts/project/console_logging_policy.md b/.brv/context-tree/facts/project/console_logging_policy.md new file mode 100644 index 0000000..6727e5e --- /dev/null +++ b/.brv/context-tree/facts/project/console_logging_policy.md @@ -0,0 +1,37 @@ +--- +title: Console Logging Policy +summary: Production code must not use console.log or similar logging because it can leak messages into native TUIs such as opencode, pi, and codex. +tags: [] +related: [] +keywords: [] +createdAt: '2026-05-25T11:13:26.206Z' +updatedAt: '2026-05-25T11:13:26.206Z' +--- +## Reason +Capture the project rule to remove console.log and similar from production code + +## Raw Concept +**Task:** +Document the prohibition on console.log in production code + +**Changes:** +- Added a production logging restriction to prevent leaks into native TUIs + +**Flow:** +production code -> avoid console.log -> prevent message leakage into native TUIs + +**Timestamp:** 2026-05-25T11:13:13.676Z + +## Narrative +### Structure +This is a project-level rule governing logging behavior in production code. + +### Dependencies +Applies to native TUI environments including opencode, pi, and codex. + +### Highlights +The stated reason is to prevent leakage of messages into terminal user interfaces. + +## Facts +- **production_console_logging_policy**: Production code must not use console.log or similar logging. [convention] +- **native_tui_logging_risk**: Console logging can leak messages into native TUIs such as opencode, pi, and codex. [project] diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 23a9e70..ef60ed0 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -5,7 +5,6 @@ async function main() { await runCli(process.argv.slice(2), { version: packageVersion }); } -main().catch((error) => { - console.error(error); +main().catch(() => { process.exit(1); }); diff --git a/packages/core/src/engine.ts b/packages/core/src/engine.ts index 3698d36..e513868 100644 --- a/packages/core/src/engine.ts +++ b/packages/core/src/engine.ts @@ -83,7 +83,7 @@ export class CapletsEngine { this.capletSets = new CapletSetManager(this.registry, selectAuthOptions(options.authDir)); this.watchDebounceMs = options.watchDebounceMs ?? 250; this.watchEnabled = options.watch ?? true; - this.writeErr = options.writeErr ?? ((value: string) => process.stderr.write(value)); + this.writeErr = options.writeErr ?? (() => undefined); if (this.watchEnabled) { this.resetWatchers(); } diff --git a/packages/core/src/native.ts b/packages/core/src/native.ts index 041269f..7d7de31 100644 --- a/packages/core/src/native.ts +++ b/packages/core/src/native.ts @@ -5,7 +5,10 @@ export { type NativeCapletsServiceOptions, type NativeCapletsToolsChangedListener, } from "./native/service"; -export { registerNativeCapletsProcessCleanup } from "./native/process-cleanup"; +export { + registerNativeCapletsProcessCleanup, + type NativeCapletsProcessCleanupOptions, +} from "./native/process-cleanup"; export { nativeCapletPromptGuidance, nativeCapletToolDescription, diff --git a/packages/core/src/native/process-cleanup.ts b/packages/core/src/native/process-cleanup.ts index 41b4cc6..bdb4b33 100644 --- a/packages/core/src/native/process-cleanup.ts +++ b/packages/core/src/native/process-cleanup.ts @@ -1,6 +1,13 @@ import type { NativeCapletsService } from "./service"; -export function registerNativeCapletsProcessCleanup(service: NativeCapletsService): void { +export type NativeCapletsProcessCleanupOptions = { + writeErr?: (message: string) => void; +}; + +export function registerNativeCapletsProcessCleanup( + service: NativeCapletsService, + options: NativeCapletsProcessCleanupOptions = {}, +): void { let closed = false; const close = async () => { if (closed) { @@ -10,7 +17,7 @@ export function registerNativeCapletsProcessCleanup(service: NativeCapletsServic try { await service.close(); } catch (error: unknown) { - console.error("Failed to close Caplets service:", error); + options.writeErr?.(`Failed to close Caplets service: ${errorMessage(error)}\n`); process.exitCode = 1; } }; @@ -26,3 +33,7 @@ export function registerNativeCapletsProcessCleanup(service: NativeCapletsServic process.once("SIGINT", closeAndExit); process.once("SIGTERM", closeAndExit); } + +function errorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} diff --git a/packages/core/src/native/remote.ts b/packages/core/src/native/remote.ts index 3620448..8a27633 100644 --- a/packages/core/src/native/remote.ts +++ b/packages/core/src/native/remote.ts @@ -232,11 +232,7 @@ export class RemoteNativeCapletsService implements NativeCapletsService { } private warn(message: string): void { - if (this.options.writeErr) { - this.options.writeErr(message); - return; - } - process.stderr.write(message); + this.options.writeErr?.(message); } } diff --git a/packages/core/src/native/service.ts b/packages/core/src/native/service.ts index 26f3064..5c7ea35 100644 --- a/packages/core/src/native/service.ts +++ b/packages/core/src/native/service.ts @@ -286,7 +286,7 @@ function warningKey(warning: { kind: string; path: string; message: string }): s } function writeErr(options: NativeCapletsServiceOptions, message: string): void { - (options.writeErr ?? ((value: string) => process.stderr.write(value)))(message); + options.writeErr?.(message); } function errorMessage(error: unknown): string { diff --git a/packages/core/test/package-boundaries.test.ts b/packages/core/test/package-boundaries.test.ts index c5b678b..3026d9f 100644 --- a/packages/core/test/package-boundaries.test.ts +++ b/packages/core/test/package-boundaries.test.ts @@ -10,6 +10,25 @@ const scannedExtensions = new Set([".ts", ".mjs"]); const ignoredDirectories = new Set(["dist", "node_modules"]); describe("package boundaries", () => { + it("keeps native-facing production code from writing directly to stdio", () => { + const nativeFacingRoots = [ + resolve(packagesRoot, "core/src/native"), + resolve(packagesRoot, "cli/src"), + resolve(packagesRoot, "opencode/src"), + resolve(packagesRoot, "pi/src"), + ]; + const violations = scanFiles(nativeFacingRoots).flatMap((filePath) => { + const source = readFileSync(filePath, "utf8"); + return Array.from( + source.matchAll( + /\bconsole\.(?:log|info|warn|error|debug|trace)\b|process\.(?:stdout|stderr)\.write\b/g, + ), + ).map((match) => `${formatPath(filePath)} uses ${match[0]}`); + }); + + expect(violations).toEqual([]); + }); + it("uses Node ESM-safe MCP SDK subpath imports", () => { const violations = scanFiles([packagesRoot]).flatMap((filePath) => { const source = readFileSync(filePath, "utf8"); diff --git a/packages/pi/src/index.ts b/packages/pi/src/index.ts index fe88e7d..472d240 100644 --- a/packages/pi/src/index.ts +++ b/packages/pi/src/index.ts @@ -64,7 +64,7 @@ export async function loadPiSettingsArgs( const projectSettingsPath = options.projectSettingsPath ?? join(process.cwd(), ".pi", "settings.json"); const readSettingsFile = options.readSettingsFile ?? readFileUtf8; - const writeWarning = options.writeWarning ?? ((message) => process.stderr.write(`${message}\n`)); + const writeWarning = options.writeWarning ?? (() => undefined); const userSettings = await readPiSettingsFile(settingsPath, readSettingsFile, writeWarning); const projectSettings = await readPiSettingsFile( projectSettingsPath, diff --git a/packages/pi/test/pi.test.ts b/packages/pi/test/pi.test.ts index 7eaa333..0118337 100644 --- a/packages/pi/test/pi.test.ts +++ b/packages/pi/test/pi.test.ts @@ -6,7 +6,11 @@ import type { NativeCapletsService, NativeCapletsServiceOptions, } from "@caplets/core/native"; -import capletsPiExtension, { createCapletsPiExtension, type PiExtensionApi } from "../src/index"; +import capletsPiExtension, { + createCapletsPiExtension, + loadPiSettingsArgs, + type PiExtensionApi, +} from "../src/index"; const nativeMocks = vi.hoisted(() => ({ createNativeCapletsService: vi.fn(), @@ -908,9 +912,7 @@ describe("@caplets/pi", () => { }); it("loads deprecated remote server fields with a warning", async () => { - const service = mockService([]); - const write = vi.spyOn(process.stderr, "write").mockImplementation(() => true); - nativeMocks.createNativeCapletsService.mockReturnValueOnce(service); + const writeWarning = vi.fn(); fsMocks.readFile.mockResolvedValueOnce( JSON.stringify({ packages: ["npm:@caplets/pi"], @@ -926,11 +928,10 @@ describe("@caplets/pi", () => { }), ); fsMocks.readFile.mockRejectedValueOnce(Object.assign(new Error("missing"), { code: "ENOENT" })); - const { api } = mockPiApi(); - await capletsPiExtension(api as unknown as PiExtensionApi); + const args = await loadPiSettingsArgs({ writeWarning }); - expect(nativeMocks.createNativeCapletsService).toHaveBeenLastCalledWith({ + expect(args).toEqual({ mode: "remote", server: { url: "https://caplets.example.com", @@ -941,8 +942,7 @@ describe("@caplets/pi", () => { pollIntervalMs: 1_000, }, }); - expect(write).toHaveBeenCalledWith(expect.stringContaining("remote.url is deprecated")); - write.mockRestore(); + expect(writeWarning).toHaveBeenCalledWith(expect.stringContaining("remote.url is deprecated")); }); it("default export loads top-level Pi settings for the native service", async () => { @@ -1015,19 +1015,15 @@ describe("@caplets/pi", () => { }); it("warns and falls back to empty args when Pi settings are malformed", async () => { - const service = mockService([]); - const write = vi.spyOn(process.stderr, "write").mockImplementation(() => true); - nativeMocks.createNativeCapletsService.mockReturnValueOnce(service); + const writeWarning = vi.fn(); fsMocks.readFile .mockResolvedValueOnce("{ not json") .mockRejectedValueOnce(Object.assign(new Error("missing"), { code: "ENOENT" })); - const { api } = mockPiApi(); - await capletsPiExtension(api as unknown as PiExtensionApi); + const args = await loadPiSettingsArgs({ writeWarning }); - expect(nativeMocks.createNativeCapletsService).toHaveBeenLastCalledWith({}); - expect(write).toHaveBeenCalledWith(expect.stringContaining("Ignoring Pi settings args")); - write.mockRestore(); + expect(args).toEqual({}); + expect(writeWarning).toHaveBeenCalledWith(expect.stringContaining("Ignoring Pi settings args")); }); it("does not show a status widget for local settings", async () => { From e25c88b451106ea88134a888042e087e017cf692 Mon Sep 17 00:00:00 2001 From: Ian Pascoe Date: Mon, 25 May 2026 07:28:19 -0400 Subject: [PATCH 2/4] chore: changeset --- .changeset/nice-readers-burn.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changeset/nice-readers-burn.md diff --git a/.changeset/nice-readers-burn.md b/.changeset/nice-readers-burn.md new file mode 100644 index 0000000..1224fb4 --- /dev/null +++ b/.changeset/nice-readers-burn.md @@ -0,0 +1,8 @@ +--- +"caplets": patch +"@caplets/core": patch +"@caplets/opencode": patch +"@caplets/pi": patch +--- + +Keep console logs from leaking into native integrations From 98952313f0cc2aa09de9904c35718143dac70c92 Mon Sep 17 00:00:00 2001 From: Ian Pascoe Date: Mon, 25 May 2026 08:10:43 -0400 Subject: [PATCH 3/4] fix: address native logging review comments --- packages/cli/src/index.ts | 7 ++++++- packages/core/src/engine.ts | 2 +- packages/core/src/native/service.ts | 5 ++++- packages/core/test/package-boundaries.test.ts | 11 ++++++++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index ef60ed0..4e67d1e 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -5,6 +5,11 @@ async function main() { await runCli(process.argv.slice(2), { version: packageVersion }); } -main().catch(() => { +main().catch((error) => { + process.stderr.write(`${errorMessage(error)}\n`); process.exit(1); }); + +function errorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} diff --git a/packages/core/src/engine.ts b/packages/core/src/engine.ts index e513868..3698d36 100644 --- a/packages/core/src/engine.ts +++ b/packages/core/src/engine.ts @@ -83,7 +83,7 @@ export class CapletsEngine { this.capletSets = new CapletSetManager(this.registry, selectAuthOptions(options.authDir)); this.watchDebounceMs = options.watchDebounceMs ?? 250; this.watchEnabled = options.watch ?? true; - this.writeErr = options.writeErr ?? (() => undefined); + this.writeErr = options.writeErr ?? ((value: string) => process.stderr.write(value)); if (this.watchEnabled) { this.resetWatchers(); } diff --git a/packages/core/src/native/service.ts b/packages/core/src/native/service.ts index 5c7ea35..a9fc481 100644 --- a/packages/core/src/native/service.ts +++ b/packages/core/src/native/service.ts @@ -98,7 +98,10 @@ class DefaultNativeCapletsService implements NativeCapletsService { private readonly engine: CapletsEngine; constructor(options: LocalNativeCapletsServiceOptions) { - this.engine = new CapletsEngine(options); + this.engine = new CapletsEngine({ + ...options, + writeErr: options.writeErr ?? (() => undefined), + }); } listTools(): NativeCapletTool[] { diff --git a/packages/core/test/package-boundaries.test.ts b/packages/core/test/package-boundaries.test.ts index 3026d9f..3c9f125 100644 --- a/packages/core/test/package-boundaries.test.ts +++ b/packages/core/test/package-boundaries.test.ts @@ -1,4 +1,4 @@ -import { readdirSync, readFileSync } from "node:fs"; +import { existsSync, readdirSync, readFileSync } from "node:fs"; import { relative, resolve, sep } from "node:path"; import { describe, expect, it } from "vitest"; import corePackage from "../package.json"; @@ -13,7 +13,6 @@ describe("package boundaries", () => { it("keeps native-facing production code from writing directly to stdio", () => { const nativeFacingRoots = [ resolve(packagesRoot, "core/src/native"), - resolve(packagesRoot, "cli/src"), resolve(packagesRoot, "opencode/src"), resolve(packagesRoot, "pi/src"), ]; @@ -29,6 +28,10 @@ describe("package boundaries", () => { expect(violations).toEqual([]); }); + it("ignores missing scan roots", () => { + expect(scanFiles([resolve(packagesRoot, "missing-package/src")])).toEqual([]); + }); + it("uses Node ESM-safe MCP SDK subpath imports", () => { const violations = scanFiles([packagesRoot]).flatMap((filePath) => { const source = readFileSync(filePath, "utf8"); @@ -91,7 +94,9 @@ describe("package boundaries", () => { function scanFiles(roots: string[]): string[] { const files: string[] = []; for (const root of roots) { - collectFiles(root, files); + if (existsSync(root)) { + collectFiles(root, files); + } } return files; } From 3281f43948b19bc275ceaff12ed748c2b29a78c9 Mon Sep 17 00:00:00 2001 From: Ian Pascoe Date: Mon, 25 May 2026 08:11:09 -0400 Subject: [PATCH 4/4] docs: update byterover context --- .brv/.gitignore | 2 + .../active_caplets_planning_documents.md | 2 +- ..._discovery_refactor_implementation_plan.md | 2 +- ...etion_local_discovery_and_split_targets.md | 2 +- .brv/context-tree/docs/plans/context.md | 2 +- ...r_image_publishing_for_release_pipeline.md | 2 +- .../plans/pr_71_completion_fix_outcome.md | 2 +- ...publish-state-not-just-workflow-success.md | 2 +- .../rlm_curation_run_conventions.md | 49 ------ .../rlm_curation_run_requirements.md | 59 +------- .../rlm_curation_single_pass_mode.md | 51 ------- ...m_single_pass_curation_run_requirements.md | 42 ------ .../conventions/task_3_spec_review_fix.md | 2 +- .../task_5_regression_test_update.md | 2 +- .../conventions/task_6_review_outcome.md | 2 +- .../task_7_remote_mutation_routing_review.md | 2 +- .../conventions/task_7_review_outcome.md | 2 +- .../task_9_remote_config_test_fix.md | 2 +- .../facts/project/console_logging_policy.md | 2 +- .../project/curate_rlm_workflow_context.md | 45 ++++++ ...eated-as-durable-project-infrastructure.md | 2 +- .../facts/project/curation_context_facts.md | 2 +- .../facts/project/curation_input_notes.md | 2 +- .../project/curation_runtime_conventions.md | 60 ++------ .../facts/project/greptile_review_comments.md | 2 +- .../project/pr_65_fixes_and_verification.md | 2 +- .../project/pr_71_completion_fix_outcome.md | 1 + .../project/remote_control_review_outcome.md | 2 +- .../project/rlm_curation_run_constraints.md | 48 ------ .../task_6_spec_review_after_envelope_fix.md | 2 +- .../pr_78_review_outcome.md | 2 +- .../project/rlm_curation_workflow/context.md | 3 + .../current_branch_completion_restore.md | 63 -------- .../rlm_curation_workflow.md | 139 +++++++----------- 34 files changed, 139 insertions(+), 467 deletions(-) delete mode 100644 .brv/context-tree/facts/conventions/rlm_curation_run_conventions.md delete mode 100644 .brv/context-tree/facts/conventions/rlm_curation_single_pass_mode.md delete mode 100644 .brv/context-tree/facts/conventions/rlm_single_pass_curation_run_requirements.md create mode 100644 .brv/context-tree/facts/project/curate_rlm_workflow_context.md delete mode 100644 .brv/context-tree/facts/project/rlm_curation_run_constraints.md delete mode 100644 .brv/context-tree/project/rlm_curation_workflow/current_branch_completion_restore.md diff --git a/.brv/.gitignore b/.brv/.gitignore index f476665..0c92c0c 100644 --- a/.brv/.gitignore +++ b/.brv/.gitignore @@ -31,6 +31,8 @@ _index.md + + # Review backups # Generated files diff --git a/.brv/context-tree/docs/plans/active_caplets_planning_documents.md b/.brv/context-tree/docs/plans/active_caplets_planning_documents.md index d2d7ab1..e74fbd5 100644 --- a/.brv/context-tree/docs/plans/active_caplets_planning_documents.md +++ b/.brv/context-tree/docs/plans/active_caplets_planning_documents.md @@ -2,7 +2,7 @@ title: Active Caplets Planning Documents summary: Active caplets planning notes covering backend, remote control, CLI, HTTP actions, GraphQL, hot reload, XDG paths, and release-related work. tags: [] -related: [architecture/remote_control/context.md, architecture/auth/context.md, docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/docker_image_publishing_for_release_pipeline.md] +related: [architecture/remote_control/context.md, architecture/auth/context.md, docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/docker_image_publishing_for_release_pipeline.md, docs/plans/context.md, docs/plans/pr_71_completion_fix_outcome.md, docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md] keywords: [] createdAt: '2026-05-21T10:20:40.246Z' updatedAt: '2026-05-21T10:21:06.053Z' diff --git a/.brv/context-tree/docs/plans/completion_discovery_refactor_implementation_plan.md b/.brv/context-tree/docs/plans/completion_discovery_refactor_implementation_plan.md index 7a274ac..a79b100 100644 --- a/.brv/context-tree/docs/plans/completion_discovery_refactor_implementation_plan.md +++ b/.brv/context-tree/docs/plans/completion_discovery_refactor_implementation_plan.md @@ -2,7 +2,7 @@ title: Completion Discovery Refactor Implementation Plan summary: Plan for shared CLI completion metadata, cache-backed discovery, completion config defaults, remote completion routing, and final verification. tags: [] -related: [architecture/remote_control/remote_control_api_shape.md, architecture/remote_control/cli_remote_mode_selection.md, docs/plans/active_caplets_planning_documents.md, docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/context.md, docs/plans/docker_image_publishing_for_release_pipeline.md] +related: [architecture/remote_control/remote_control_api_shape.md, architecture/remote_control/cli_remote_mode_selection.md, docs/plans/active_caplets_planning_documents.md, docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/context.md, docs/plans/docker_image_publishing_for_release_pipeline.md, docs/plans/pr_71_completion_fix_outcome.md, docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md] keywords: [] createdAt: '2026-05-21T17:14:24.407Z' updatedAt: '2026-05-21T17:14:24.407Z' diff --git a/.brv/context-tree/docs/plans/completion_local_discovery_and_split_targets.md b/.brv/context-tree/docs/plans/completion_local_discovery_and_split_targets.md index 021fd6e..eec9a3f 100644 --- a/.brv/context-tree/docs/plans/completion_local_discovery_and_split_targets.md +++ b/.brv/context-tree/docs/plans/completion_local_discovery_and_split_targets.md @@ -2,7 +2,7 @@ title: Completion Local Discovery and Split Targets summary: Plan saved for fixing local live discovery of existing caplet.tool completions and adding split targets, with formatting verified. tags: [] -related: [docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/context.md, docs/plans/active_caplets_planning_documents.md] +related: [docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/context.md, docs/plans/active_caplets_planning_documents.md, docs/plans/docker_image_publishing_for_release_pipeline.md, docs/plans/pr_71_completion_fix_outcome.md, docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md] keywords: [] createdAt: '2026-05-21T23:07:39.925Z' updatedAt: '2026-05-21T23:07:39.925Z' diff --git a/.brv/context-tree/docs/plans/context.md b/.brv/context-tree/docs/plans/context.md index d7619aa..928b5ab 100644 --- a/.brv/context-tree/docs/plans/context.md +++ b/.brv/context-tree/docs/plans/context.md @@ -1,5 +1,5 @@ --- -related: [docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/completion_discovery_refactor_implementation_plan.md] +related: [docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/active_caplets_planning_documents.md, docs/plans/docker_image_publishing_for_release_pipeline.md, docs/plans/pr_71_completion_fix_outcome.md, docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md] --- # Topic: plans diff --git a/.brv/context-tree/docs/plans/docker_image_publishing_for_release_pipeline.md b/.brv/context-tree/docs/plans/docker_image_publishing_for_release_pipeline.md index 073ec07..2801835 100644 --- a/.brv/context-tree/docs/plans/docker_image_publishing_for_release_pipeline.md +++ b/.brv/context-tree/docs/plans/docker_image_publishing_for_release_pipeline.md @@ -2,7 +2,7 @@ title: Docker Image Publishing for Release Pipeline summary: 'Release workflow should publish GHCR Docker images only after Changesets publishes npm packages, with packages: write permission and Docker build/login steps gated on published releases.' tags: [] -related: [architecture/remote_control/release_workflow.md, docs/plans/active_caplets_planning_documents.md, docs/plans/completion_discovery_refactor_implementation_plan.md] +related: [architecture/remote_control/release_workflow.md, docs/plans/active_caplets_planning_documents.md, docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/context.md, docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/pr_71_completion_fix_outcome.md, docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md] keywords: [] createdAt: '2026-05-21T09:58:44.922Z' updatedAt: '2026-05-21T09:58:44.922Z' diff --git a/.brv/context-tree/docs/plans/pr_71_completion_fix_outcome.md b/.brv/context-tree/docs/plans/pr_71_completion_fix_outcome.md index cbddd22..857d577 100644 --- a/.brv/context-tree/docs/plans/pr_71_completion_fix_outcome.md +++ b/.brv/context-tree/docs/plans/pr_71_completion_fix_outcome.md @@ -2,7 +2,7 @@ title: PR 71 Completion Fix Outcome summary: Completion-related PR review fixes were implemented and verified with focused tests and pnpm verify, with no unresolved outside-diff review threads found. tags: [] -related: [] +related: [docs/plans/context.md, docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/active_caplets_planning_documents.md, docs/plans/docker_image_publishing_for_release_pipeline.md, docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md] keywords: [] createdAt: '2026-05-22T10:56:26.474Z' updatedAt: '2026-05-22T10:56:26.474Z' diff --git a/.brv/context-tree/docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md b/.brv/context-tree/docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md index 59788d5..3a42b8a 100644 --- a/.brv/context-tree/docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md +++ b/.brv/context-tree/docs/plans/release-automation-is-gated-by-verified-publish-state-not-just-workflow-success.md @@ -6,7 +6,7 @@ type: synthesis title: Release automation is gated by verified publish state, not just workflow success summary: The release pipeline only publishes Docker images after Changesets confirms a real npm publish, with validation checkpoints documented alongside it. tags: [release, docker, changesets, verification] -related: [] +related: [docs/plans/context.md, docs/plans/completion_local_discovery_and_split_targets.md, docs/plans/completion_discovery_refactor_implementation_plan.md, docs/plans/active_caplets_planning_documents.md, docs/plans/docker_image_publishing_for_release_pipeline.md, docs/plans/pr_71_completion_fix_outcome.md] keywords: [publish, changesets, ghcr, docker, gating, workflow, validation, release] createdAt: '2026-05-21T23:23:26.220Z' updatedAt: '2026-05-21T23:23:26.220Z' diff --git a/.brv/context-tree/facts/conventions/rlm_curation_run_conventions.md b/.brv/context-tree/facts/conventions/rlm_curation_run_conventions.md deleted file mode 100644 index d154d4d..0000000 --- a/.brv/context-tree/facts/conventions/rlm_curation_run_conventions.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: RLM Curation Run Conventions -summary: RLM curation run conventions for single-pass execution, mapExtract timeout, bare taskId usage, and verification via applied file paths -tags: [] -related: [facts/conventions/rlm_curation_single_pass_mode.md, facts/conventions/rlm_single_pass_curation_run_requirements.md] -keywords: [] -createdAt: '2026-05-24T18:39:19.487Z' -updatedAt: '2026-05-24T19:10:11.003Z' ---- -## Reason -Document the observed RLM curation run rules and verification requirements - -## Raw Concept -**Task:** -Document the RLM curation run conventions used for this session - -**Changes:** -- Single-pass mode is used when recon suggests single-pass -- mapExtract calls require timeout 300000 on the code_exec call -- taskId must be passed as a bare variable -- Verification uses result.applied[].filePath instead of readFile -- Single-pass mode is used when recon recommends it -- Chunked extraction uses tools.curation.mapExtract -- Verification relies on result.applied[].filePath rather than readFile - -**Flow:** -recon -> single-pass extract -> curate -> verify applied file paths - -**Timestamp:** 2026-05-24T19:10:02.801Z - -**Author:** ByteRover context engineer - -## Narrative -### Structure -This note captures the execution rules for RLM curation runs, including when to skip chunking and how to verify curated output. - -### Dependencies -Depends on recon guidance, tools.curation.mapExtract for chunked extraction, and tools.curate for persistence. - -### Highlights -Single-pass mode is recommended for small contexts; mapExtract calls require a 300000 ms timeout at the code_exec level; verification is based on applied file paths. - -## Facts -- **rlm_curation_mode**: RLM curation uses a single-pass mode when recon suggests single-pass [convention] -- **rlm_curation_workflow**: For single-pass contexts, the workflow skips chunking and proceeds directly from recon to curate [convention] -- **rlm_curation_extraction**: When context is chunked, tools.curation.mapExtract is used for parallel extraction [convention] -- **mapextract_timeout**: Any code_exec call containing mapExtract must use timeout 300000 on the tool call itself [convention] -- **mapextract_taskid**: The taskId must be passed as a bare variable, not a string, when calling mapExtract [convention] -- **curation_verification**: Curation verification should use result.applied[].filePath and should not call readFile for verification [convention] diff --git a/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md b/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md index dcb5062..ee3b937 100644 --- a/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md +++ b/.brv/context-tree/facts/conventions/rlm_curation_run_requirements.md @@ -1,59 +1,4 @@ --- -title: RLM Curation Run Requirements -summary: RLM curation run requirements covering single-pass handling, context safety, verification, and curation workflow expectations. -tags: [] -related: [facts/conventions/rlm_curation_single_pass_mode.md, facts/conventions/rlm_curation_run_conventions.md, facts/conventions/context.md] -keywords: [] -createdAt: '2026-05-25T10:03:04.676Z' -updatedAt: '2026-05-25T11:23:15.737Z' +consolidated_at: '2026-05-25T11:38:36.992Z' --- -## Reason -Curate single-pass RLM curation requirements and conventions from the provided context - -## Raw Concept -**Task:** -Document the RLM curation run requirements and execution conventions for this single-pass curation context. - -**Changes:** -- Use recon-suggested single-pass mode for small contexts -- Pass taskId as a bare variable to mapExtract -- Set the outer code_exec timeout to 300000 ms for mapExtract -- Verify curation via result.applied[].filePath without readFile -- Captured the precomputed recon result usage for single-pass handling -- Captured the required timeout rule for mapExtract calls -- Captured the verification rule using applied file paths -- Recorded pre-computed recon usage for single-pass mode -- Recorded timeout requirement for mapExtract tool calls -- Recorded verification rule using applied file paths -- Recorded the precomputed recon result and single-pass recommendation -- Captured the requirement to avoid printing raw context -- Captured verification guidance using applied file paths - -**Flow:** -precomputed recon -> single-pass curation -> curate UPSERT -> verify applied file paths -> report status - -**Timestamp:** 2026-05-25T11:23:05.351Z - -**Author:** ByteRover context engineer - -**Patterns:** -- `^single-pass$` - Suggested mode for the provided compact context - -## Narrative -### Structure -This knowledge covers how to handle an RLM curation run when the context is small enough for a single-pass operation. - -### Dependencies -Depends on the precomputed recon result, the provided context/history/metadata variables, and the curation API. - -### Highlights -Single-pass mode was recommended. The instructions emphasize not printing raw context, not re-running recon, and verifying success from applied file paths. - -### Rules -Do NOT print raw context. Do NOT call tools.curation.recon. Proceed directly to extraction. Verify via result.applied[].filePath. - -## Facts -- **curation_mode**: The context is small enough for single-pass curation. [convention] -- **recon_status**: Recon was already computed before curation and suggested single-pass mode. [convention] -- **context_logging_policy**: The curation workflow must not print raw context. [convention] -- **verification_method**: Verification must use result.applied[].filePath and not readFile. [convention] +Document the RLM curation runtime rules as a chronological policy: earlier sessions established precomputed recon, single-pass handling for compact contexts, no raw-context printing, bare taskId usage for mapExtract, the 300000 ms outer code_exec timeout when mapExtract is present, and verification via result.applied[].filePath. Later sessions reiterated the same guidance and added stronger canonical wording around UPSERT preference, result.summary.failed checks, and use of tools.curation.groupBySubject() and tools.curation.dedup() to organize extracted facts. The current canonical rule is that small, pre-reconciled contexts should proceed directly in single-pass mode; chunked extraction is only for larger contexts. \ No newline at end of file diff --git a/.brv/context-tree/facts/conventions/rlm_curation_single_pass_mode.md b/.brv/context-tree/facts/conventions/rlm_curation_single_pass_mode.md deleted file mode 100644 index 7dfd44a..0000000 --- a/.brv/context-tree/facts/conventions/rlm_curation_single_pass_mode.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: RLM Curation Single-Pass Mode -summary: RLM curation uses precomputed recon and proceeds directly in single-pass mode when suggestedMode is single-pass. -tags: [] -related: [facts/curation_runtime_conventions.md, facts/project/curation_runtime_conventions.md] -keywords: [] -createdAt: '2026-05-24T13:52:05.605Z' -updatedAt: '2026-05-24T16:41:52.705Z' ---- -## Reason -Capture the operational convention for single-pass RLM curation runs from the provided context. - -## Raw Concept -**Task:** -Document the RLM curation execution convention for precomputed recon and single-pass processing. - -**Changes:** -- Used precomputed recon result instead of recomputing -- Accepted suggested single-pass mode with one chunk -- Prepared facts from the run metadata and context sizing -- Established that recon is precomputed and should not be called again in this run -- Recorded single-pass mode guidance for small contexts -- Recorded chunked extraction requirements, including taskId and timeout handling -- Recorded verification requirements for curated output -- Use precomputed recon instead of recalculating it during curation -- Proceed directly to extraction when suggestedMode is single-pass -- Use taskId as a bare variable when invoking mapExtract for chunked extraction - -**Flow:** -recon precomputed -> inspect suggestedMode -> single-pass extraction/curation -> verify applied file paths - -**Timestamp:** 2026-05-24T16:41:43.099Z - -**Author:** ByteRover context engineer - -## Narrative -### Structure -This knowledge captures the execution rule for RLM curation runs and the requirement to trust the precomputed recon result for mode selection. - -### Dependencies -Depends on the precomputed recon variables and the curation runtime conventions for organizing extracted facts. - -### Highlights -The provided task explicitly instructed not to call tools.curation.recon again and to verify success using result.applied[].filePath. - -### Rules -IMPORTANT: Do NOT print raw context. Do NOT call tools.curation.recon — it has been pre-computed. Proceed directly to extraction. For chunked extraction use tools.curation.mapExtract(). Pass taskId: __taskId_b710f89b_37e2_493b_a382_f6f4c79ac5b3 (bare variable, not a string). IMPORTANT: Any code_exec call containing mapExtract MUST use timeout: 300000 on the code_exec tool call itself (not inside mapExtract options). Use tools.curation.groupBySubject() and tools.curation.dedup() to organize extractions. Verify via result.applied[].filePath — do NOT call readFile for verification. - -## Facts -- **rlm_curation_mode**: Curation requests for this task use the RLM approach with precomputed recon and direct single-pass processing when suggestedMode is single-pass. [convention] -- **recon_assessment**: The current context was pre-assessed with suggestedMode single-pass, suggestedChunkCount 1, charCount 2658, lineCount 41, and messageCount 0. [project] diff --git a/.brv/context-tree/facts/conventions/rlm_single_pass_curation_run_requirements.md b/.brv/context-tree/facts/conventions/rlm_single_pass_curation_run_requirements.md deleted file mode 100644 index 5fbefcb..0000000 --- a/.brv/context-tree/facts/conventions/rlm_single_pass_curation_run_requirements.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: RLM Single-Pass Curation Run Requirements -summary: 'RLM curation run requirements for small contexts: precomputed recon, single-pass processing, no raw context printing, mapExtract timeout and taskId handling, and verification via file paths.' -tags: [] -related: [] -keywords: [] -createdAt: '2026-05-24T15:45:50.096Z' -updatedAt: '2026-05-24T15:45:50.096Z' ---- -## Reason -Capture the curation run instructions provided in the prompt as durable conventions. - -## Raw Concept -**Task:** -Document the RLM curation run requirements for this session - -**Changes:** -- Use single-pass mode for the provided small context -- Do not rerun recon because it was already computed -- Preserve the instruction to avoid raw context printing -- Use the specified mapExtract timeout and bare taskId variable rule -- Verify applied file paths after curation - -**Flow:** -recon precomputed -> extract relevant facts -> curate with UPSERT -> verify applied file paths -> report status - -**Timestamp:** 2026-05-24T15:45:38.847Z - -**Author:** ByteRover RLM curation instructions - -## Narrative -### Structure -This note captures the execution constraints for an RLM curation run on a small, pre-reconciled context. - -### Dependencies -Depends on the precomputed recon output, the provided task ID variable, and the curate result object for verification. - -### Highlights -The run is explicitly single-pass and should not use recon again; if mapExtract is used in future runs, the tool-call timeout must be 300000 ms. - -### Rules -Do NOT print raw context. Do NOT call tools.curation.recon — it has been pre-computed. Proceed directly to extraction. For chunked extraction use tools.curation.mapExtract(). Pass taskId as a bare variable, not a string. IMPORTANT: Any code_exec call containing mapExtract MUST use timeout: 300000 on the code_exec tool call itself (not inside mapExtract options). Use tools.curation.groupBySubject() and tools.curation.dedup() to organize extractions. Verify via result.applied[].filePath — do NOT call readFile for verification. diff --git a/.brv/context-tree/facts/conventions/task_3_spec_review_fix.md b/.brv/context-tree/facts/conventions/task_3_spec_review_fix.md index 80feada..621c376 100644 --- a/.brv/context-tree/facts/conventions/task_3_spec_review_fix.md +++ b/.brv/context-tree/facts/conventions/task_3_spec_review_fix.md @@ -2,7 +2,7 @@ title: Task 3 Spec Review Fix summary: 'Task 3 fix: IPv6 loopback serve URLs now bind with ::1, CLI help text updated, focused tests passed, commit cdde479' tags: [] -related: [] +related: [facts/conventions/task_5_regression_test_update.md, facts/conventions/task_6_review_outcome.md, facts/project/task_6_spec_review_after_envelope_fix.md, facts/conventions/task_7_review_outcome.md, facts/conventions/task_7_remote_mutation_routing_review.md, facts/conventions/task_9_remote_config_test_fix.md] keywords: [] createdAt: '2026-05-20T12:56:28.017Z' updatedAt: '2026-05-20T12:56:28.017Z' diff --git a/.brv/context-tree/facts/conventions/task_5_regression_test_update.md b/.brv/context-tree/facts/conventions/task_5_regression_test_update.md index 67dc513..712e82e 100644 --- a/.brv/context-tree/facts/conventions/task_5_regression_test_update.md +++ b/.brv/context-tree/facts/conventions/task_5_regression_test_update.md @@ -2,7 +2,7 @@ title: Task 5 Regression Test Update summary: Added regression tests for remote add rejecting server-owned fields; tests passed and commit 089542d was created with a note about unrelated worktree changes. tags: [] -related: [] +related: [facts/conventions/task_3_spec_review_fix.md, facts/conventions/task_6_review_outcome.md, facts/project/task_6_spec_review_after_envelope_fix.md, facts/conventions/task_7_review_outcome.md, facts/conventions/task_7_remote_mutation_routing_review.md, facts/conventions/task_9_remote_config_test_fix.md] keywords: [] createdAt: '2026-05-20T13:52:39.382Z' updatedAt: '2026-05-20T13:52:39.382Z' diff --git a/.brv/context-tree/facts/conventions/task_6_review_outcome.md b/.brv/context-tree/facts/conventions/task_6_review_outcome.md index 5d2bf6a..774f499 100644 --- a/.brv/context-tree/facts/conventions/task_6_review_outcome.md +++ b/.brv/context-tree/facts/conventions/task_6_review_outcome.md @@ -2,7 +2,7 @@ title: Task 6 Review Outcome summary: Task 6 review approved; nested engine request envelope validation is correct, old CAPLETS_REMOTE_* docs belong to Task 10, and source/test verification passed. tags: [] -related: [] +related: [facts/conventions/task_3_spec_review_fix.md, facts/conventions/task_5_regression_test_update.md, facts/project/task_6_spec_review_after_envelope_fix.md, facts/conventions/task_7_review_outcome.md, facts/conventions/task_7_remote_mutation_routing_review.md, facts/conventions/task_9_remote_config_test_fix.md] keywords: [] createdAt: '2026-05-20T14:17:40.238Z' updatedAt: '2026-05-20T14:17:40.238Z' diff --git a/.brv/context-tree/facts/conventions/task_7_remote_mutation_routing_review.md b/.brv/context-tree/facts/conventions/task_7_remote_mutation_routing_review.md index fb22d0b..a780133 100644 --- a/.brv/context-tree/facts/conventions/task_7_remote_mutation_routing_review.md +++ b/.brv/context-tree/facts/conventions/task_7_remote_mutation_routing_review.md @@ -2,7 +2,7 @@ title: Task 7 Remote Mutation Routing Review summary: Task 7 remote mutation routing review was approved; remote add/init/install flows, server-side boundary validation, response parsing, and redaction were verified, with tests and typecheck passing. tags: [] -related: [architecture/remote_control/context.md, architecture/remote_control/remote_control_api_shape.md] +related: [architecture/remote_control/context.md, architecture/remote_control/remote_control_api_shape.md, facts/conventions/task_3_spec_review_fix.md, facts/conventions/task_5_regression_test_update.md, facts/conventions/task_6_review_outcome.md, facts/project/task_6_spec_review_after_envelope_fix.md, facts/conventions/task_7_review_outcome.md, facts/conventions/task_9_remote_config_test_fix.md] keywords: [] createdAt: '2026-05-20T14:35:11.652Z' updatedAt: '2026-05-20T14:35:11.652Z' diff --git a/.brv/context-tree/facts/conventions/task_7_review_outcome.md b/.brv/context-tree/facts/conventions/task_7_review_outcome.md index f41dfdb..b36b99d 100644 --- a/.brv/context-tree/facts/conventions/task_7_review_outcome.md +++ b/.brv/context-tree/facts/conventions/task_7_review_outcome.md @@ -2,7 +2,7 @@ title: Task 7 Review Outcome summary: Task 7 review approved after verifying remote add payload sanitization and add-subcommand coverage; tests passed tags: [] -related: [] +related: [facts/conventions/task_3_spec_review_fix.md, facts/conventions/task_5_regression_test_update.md, facts/conventions/task_6_review_outcome.md, facts/project/task_6_spec_review_after_envelope_fix.md, facts/conventions/task_7_remote_mutation_routing_review.md, facts/conventions/task_9_remote_config_test_fix.md] keywords: [] createdAt: '2026-05-20T14:30:35.963Z' updatedAt: '2026-05-20T14:30:35.963Z' diff --git a/.brv/context-tree/facts/conventions/task_9_remote_config_test_fix.md b/.brv/context-tree/facts/conventions/task_9_remote_config_test_fix.md index 0b2e6c8..a27ddac 100644 --- a/.brv/context-tree/facts/conventions/task_9_remote_config_test_fix.md +++ b/.brv/context-tree/facts/conventions/task_9_remote_config_test_fix.md @@ -2,7 +2,7 @@ title: Task 9 Remote Config Test Fix summary: Task 9 fix updated the in-process remote control app test to snapshot local.configPath before runCli and assert it remains unchanged; focused tests passed and commit c9f08ac was created. tags: [] -related: [] +related: [facts/conventions/task_3_spec_review_fix.md, facts/conventions/task_5_regression_test_update.md, facts/conventions/task_6_review_outcome.md, facts/project/task_6_spec_review_after_envelope_fix.md, facts/conventions/task_7_review_outcome.md, facts/conventions/task_7_remote_mutation_routing_review.md] keywords: [] createdAt: '2026-05-20T15:14:33.118Z' updatedAt: '2026-05-20T15:14:33.118Z' diff --git a/.brv/context-tree/facts/project/console_logging_policy.md b/.brv/context-tree/facts/project/console_logging_policy.md index 6727e5e..d9b4ad9 100644 --- a/.brv/context-tree/facts/project/console_logging_policy.md +++ b/.brv/context-tree/facts/project/console_logging_policy.md @@ -2,7 +2,7 @@ title: Console Logging Policy summary: Production code must not use console.log or similar logging because it can leak messages into native TUIs such as opencode, pi, and codex. tags: [] -related: [] +related: [facts/project/curation_runtime_conventions.md] keywords: [] createdAt: '2026-05-25T11:13:26.206Z' updatedAt: '2026-05-25T11:13:26.206Z' diff --git a/.brv/context-tree/facts/project/curate_rlm_workflow_context.md b/.brv/context-tree/facts/project/curate_rlm_workflow_context.md new file mode 100644 index 0000000..7206c2e --- /dev/null +++ b/.brv/context-tree/facts/project/curate_rlm_workflow_context.md @@ -0,0 +1,45 @@ +--- +title: Curate RLM workflow context +summary: 'RLM curation run requirements: use recon results, prefer single-pass for small contexts, preserve facts, verify applied file paths, and report final status from curate results.' +tags: [] +related: [] +keywords: [] +createdAt: '2026-05-25T11:56:56.637Z' +updatedAt: '2026-05-25T11:56:56.637Z' +--- +## Reason +Capture durable curation workflow requirements and execution order from the provided RLM context. + +## Raw Concept +**Task:** +Document the required RLM curation workflow for this run. + +**Changes:** +- Use precomputed recon output only +- Proceed directly to extraction or single-pass curation +- Verify applied file paths from curate results +- Report final status with summary and verification + +**Flow:** +precomputed recon -> extract or single-pass curate -> verify applied file paths -> report status + +**Timestamp:** 2026-05-25T11:56:48.655Z + +**Author:** ByteRover context engineer + +## Narrative +### Structure +This context captures run-specific RLM instructions, including the required execution order, timeout rule for mapExtract, and verification constraints. + +### Dependencies +Depends on precomputed recon metadata and history variables supplied for the current task. + +### Highlights +Suggested mode is single-pass with one chunk. The run must avoid rereading raw context and must verify output via curate application metadata. + +## Facts +- **curation_mode**: The current curation run uses RLM approach with precomputed recon and single-pass mode. [convention] +- **recon_usage**: For single-pass contexts, do not call tools.curation.recon again. [convention] +- **mapextract_timeout**: When mapExtract is used in code_exec, the timeout must be set to 300000 on the tool call itself. [convention] +- **verification_method**: Verification for curation should use result.applied[].filePath and not readFile. [convention] +- **task_id_variable**: The task id for this run is provided as a bare variable named __taskId_c163554f_d585_4615_9584_4e2b6c8d2fec. [other] diff --git a/.brv/context-tree/facts/project/curation-itself-is-treated-as-durable-project-infrastructure.md b/.brv/context-tree/facts/project/curation-itself-is-treated-as-durable-project-infrastructure.md index 152b4fd..0c9ac12 100644 --- a/.brv/context-tree/facts/project/curation-itself-is-treated-as-durable-project-infrastructure.md +++ b/.brv/context-tree/facts/project/curation-itself-is-treated-as-durable-project-infrastructure.md @@ -6,7 +6,7 @@ type: synthesis title: Curation itself is treated as durable project infrastructure summary: The knowledge base records curation rules and project facts as first-class runtime knowledge, not chat-only notes. tags: [curation, runtime, knowledge-base, conventions] -related: [] +related: [facts/project/curation_context_facts.md, facts/project/curation_input_notes.md] keywords: [upsert, durable, facts, narrative, verification, knowledge, curation, policy] createdAt: '2026-05-21T23:23:26.222Z' updatedAt: '2026-05-21T23:23:26.222Z' diff --git a/.brv/context-tree/facts/project/curation_context_facts.md b/.brv/context-tree/facts/project/curation_context_facts.md index c2fd9a4..0131c07 100644 --- a/.brv/context-tree/facts/project/curation_context_facts.md +++ b/.brv/context-tree/facts/project/curation_context_facts.md @@ -2,7 +2,7 @@ title: Curation Context Facts summary: Project facts and runtime conventions extracted from the curation context, including task metadata and processing guidance. tags: [] -related: [] +related: [facts/project/curation_input_notes.md, facts/project/curation-itself-is-treated-as-durable-project-infrastructure.md] keywords: [] createdAt: '2026-05-20T19:28:15.751Z' updatedAt: '2026-05-20T19:28:15.751Z' diff --git a/.brv/context-tree/facts/project/curation_input_notes.md b/.brv/context-tree/facts/project/curation_input_notes.md index 81505e3..b2f9e4d 100644 --- a/.brv/context-tree/facts/project/curation_input_notes.md +++ b/.brv/context-tree/facts/project/curation_input_notes.md @@ -2,7 +2,7 @@ title: Curation Input Notes summary: Captured the provided curation input as durable project knowledge. tags: [] -related: [] +related: [facts/project/curation_context_facts.md, facts/project/curation-itself-is-treated-as-durable-project-infrastructure.md] keywords: [] createdAt: '2026-05-20T17:11:58.075Z' updatedAt: '2026-05-20T17:11:58.075Z' diff --git a/.brv/context-tree/facts/project/curation_runtime_conventions.md b/.brv/context-tree/facts/project/curation_runtime_conventions.md index 1000b9a..0bdce5b 100644 --- a/.brv/context-tree/facts/project/curation_runtime_conventions.md +++ b/.brv/context-tree/facts/project/curation_runtime_conventions.md @@ -1,56 +1,11 @@ --- -title: Curation Runtime Conventions -summary: Curation runtime conventions covering RLM workflow, single-pass recon guidance, mapExtract usage, UPSERT preference, verification requirements, and context quality rules. -tags: [] -related: [] -keywords: [] -createdAt: '2026-05-22T10:00:59.917Z' -updatedAt: '2026-05-22T10:00:59.917Z' +consolidated_at: '2026-05-25T11:38:36.975Z' +consolidated_from: [{date: '2026-05-25T11:38:36.975Z', path: facts/conventions/rlm_curation_run_requirements.md, reason: 'These files all document the same RLM curation runtime policy: precomputed recon, single-pass handling for small contexts, no raw-context printing, mapExtract timeout/taskId rules, UPSERT workflow, and verification via result.applied[].filePath. They are substantially overlapping and should be consolidated into one canonical requirements/conventions note.'}, {date: '2026-05-25T11:38:36.975Z', path: facts/conventions/rlm_curation_run_conventions.md, reason: 'These files all document the same RLM curation runtime policy: precomputed recon, single-pass handling for small contexts, no raw-context printing, mapExtract timeout/taskId rules, UPSERT workflow, and verification via result.applied[].filePath. They are substantially overlapping and should be consolidated into one canonical requirements/conventions note.'}, {date: '2026-05-25T11:38:36.975Z', path: facts/conventions/rlm_curation_single_pass_mode.md, reason: 'These files all document the same RLM curation runtime policy: precomputed recon, single-pass handling for small contexts, no raw-context printing, mapExtract timeout/taskId rules, UPSERT workflow, and verification via result.applied[].filePath. They are substantially overlapping and should be consolidated into one canonical requirements/conventions note.'}, {date: '2026-05-25T11:38:36.975Z', path: facts/conventions/rlm_single_pass_curation_run_requirements.md, reason: 'These files all document the same RLM curation runtime policy: precomputed recon, single-pass handling for small contexts, no raw-context printing, mapExtract timeout/taskId rules, UPSERT workflow, and verification via result.applied[].filePath. They are substantially overlapping and should be consolidated into one canonical requirements/conventions note.'}, {date: '2026-05-25T11:38:36.975Z', path: facts/project/rlm_curation_run_constraints.md, reason: 'These files all document the same RLM curation runtime policy: precomputed recon, single-pass handling for small contexts, no raw-context printing, mapExtract timeout/taskId rules, UPSERT workflow, and verification via result.applied[].filePath. They are substantially overlapping and should be consolidated into one canonical requirements/conventions note.'}] +related: [facts/project/console_logging_policy.md] --- -## Reason -Capture runtime conventions and workflow constraints from the provided curation context - -## Raw Concept -**Task:** -Document the runtime conventions and workflow rules for curation in this environment - -**Changes:** -- Captured RLM curation workflow guidance -- Recorded single-pass handling when recon recommends it -- Recorded verification and UPSERT preferences - -**Flow:** -recon -> extract if needed -> curate -> verify - -**Timestamp:** 2026-05-22T10:00:48.913Z - -**Author:** ByteRover context engineer - -## Narrative -### Structure -The guidance defines how to process curation contexts, including when to use single-pass versus chunked extraction and how to verify applied results. - -### Dependencies -Depends on recon output, tools.curation.mapExtract() for chunked contexts, and tools.curate() for final knowledge writes. - -### Highlights -The context emphasizes not printing raw context, using bare taskId for mapExtract when needed, and checking curation summaries for failures. - -### Rules -IMPORTANT: Do NOT print raw context. Do NOT call tools.curation.recon when recon has already been pre-computed. For chunked extraction use tools.curation.mapExtract(). Pass taskId as a bare variable, not a string. Verify via result.applied[].filePath — do NOT call readFile for verification. - -## Facts -- **curation_workflow**: For curation tasks, use the RLM approach with recon, extraction, and curate phases. [convention] -- **single_pass_mode**: When recon suggests single-pass, skip chunking and curate directly. [convention] -- **default_curate_operation**: Use UPSERT by default for curation operations. [convention] -- **chunked_extraction_tool**: If a context is chunked, use tools.curation.mapExtract() for parallel extraction. [convention] -- **curation_verification**: Verify curation results via result.summary.failed and result.applied[].filePath. [convention] - ---- - # Title: Curation Runtime Conventions -## Purpose +## Summary Canonical runtime guidance for RLM curation sessions: use precomputed recon, choose single-pass for small contexts, fall back to chunked mapExtract only when needed, and verify results through applied file paths rather than filesystem reads. ## Core Workflow @@ -77,3 +32,10 @@ precomputed recon -> inspect suggestedMode -> single-pass curate or chunked extr ## Temporal Note This guidance has appeared in multiple curation sessions over time; the canonical file should preserve the newest and most complete wording while noting that older session-specific entries existed and were later consolidated. + +## Facts +- Single-pass mode is recommended when recon suggests it for small contexts. +- Chunked extraction is reserved for larger contexts. +- Precomputed recon is the source of truth for mode selection. +- Verification should rely on curated result output, not rereading files. +- Session variables may include context, history, metadata, and task ID names that should be used directly. diff --git a/.brv/context-tree/facts/project/greptile_review_comments.md b/.brv/context-tree/facts/project/greptile_review_comments.md index 1902984..1067809 100644 --- a/.brv/context-tree/facts/project/greptile_review_comments.md +++ b/.brv/context-tree/facts/project/greptile_review_comments.md @@ -2,7 +2,7 @@ title: Greptile Review Comments summary: Two remaining Greptile review comments were noted, along with passing PR checks. tags: [] -related: [] +related: [facts/project/pr_65_fixes_and_verification.md, facts/project/pr_71_completion_fix_outcome.md, facts/project/remote_control_review_outcome.md] keywords: [] createdAt: '2026-05-20T19:26:36.972Z' updatedAt: '2026-05-20T19:26:36.972Z' diff --git a/.brv/context-tree/facts/project/pr_65_fixes_and_verification.md b/.brv/context-tree/facts/project/pr_65_fixes_and_verification.md index b6547c7..87f5e6b 100644 --- a/.brv/context-tree/facts/project/pr_65_fixes_and_verification.md +++ b/.brv/context-tree/facts/project/pr_65_fixes_and_verification.md @@ -2,7 +2,7 @@ title: PR 65 Fixes and Verification summary: 'PR #65 fix for Pi legacy remote settings and auth-flow object isolation, with verification passing locally and on push hook' tags: [] -related: [] +related: [facts/project/pr_71_completion_fix_outcome.md, facts/project/remote_control_review_outcome.md, facts/project/greptile_review_comments.md] keywords: [] createdAt: '2026-05-20T19:06:59.769Z' updatedAt: '2026-05-20T19:06:59.769Z' diff --git a/.brv/context-tree/facts/project/pr_71_completion_fix_outcome.md b/.brv/context-tree/facts/project/pr_71_completion_fix_outcome.md index eed2bdf..c86f2d8 100644 --- a/.brv/context-tree/facts/project/pr_71_completion_fix_outcome.md +++ b/.brv/context-tree/facts/project/pr_71_completion_fix_outcome.md @@ -1,6 +1,7 @@ --- consolidated_at: '2026-05-21T23:23:02.290Z' consolidated_from: [{date: '2026-05-21T23:23:02.290Z', path: facts/project/pr_71_completion_commands_sync.md, reason: 'These two PR #71 outcome files describe the same completion-related fix and verification cycle, with one focusing on command parity/stderr suppression and the other on the PowerShell sentinel/endpoint normalization issue. They are complementary parts of the same PR outcome and should be merged into a single consolidated PR #71 completion fixes note.'}] +related: [facts/project/pr_65_fixes_and_verification.md, facts/project/remote_control_review_outcome.md, facts/project/greptile_review_comments.md] --- # Title: PR 71 Completion Fix Outcome diff --git a/.brv/context-tree/facts/project/remote_control_review_outcome.md b/.brv/context-tree/facts/project/remote_control_review_outcome.md index e62927b..c09c230 100644 --- a/.brv/context-tree/facts/project/remote_control_review_outcome.md +++ b/.brv/context-tree/facts/project/remote_control_review_outcome.md @@ -2,7 +2,7 @@ title: Remote Control Review Outcome summary: 'Approved remote control review: server-side redaction fixed, regression tests added, CLI pending auth wording accepted, with residual spec mismatch noted.' tags: [] -related: [] +related: [facts/project/pr_65_fixes_and_verification.md, facts/project/pr_71_completion_fix_outcome.md, facts/project/greptile_review_comments.md] keywords: [] createdAt: '2026-05-20T15:41:00.585Z' updatedAt: '2026-05-20T15:41:00.585Z' diff --git a/.brv/context-tree/facts/project/rlm_curation_run_constraints.md b/.brv/context-tree/facts/project/rlm_curation_run_constraints.md deleted file mode 100644 index ba1351e..0000000 --- a/.brv/context-tree/facts/project/rlm_curation_run_constraints.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: RLM Curation Run Constraints -summary: Runtime curation run constraints for an RLM single-pass context, including task metadata, recon mode, and verification expectations -tags: [] -related: [] -keywords: [] -createdAt: '2026-05-21T10:16:00.571Z' -updatedAt: '2026-05-21T10:16:00.571Z' ---- - -## Reason - -Capture runtime curation instructions and run metadata from the provided context - -## Raw Concept - -**Task:** -Curate using RLM approach - -**Changes:** -- Single-pass mode was recommended by recon -- Context variables and task ID were provided for immediate curation -- Verification must use result.applied[].filePath and avoid readFile - -**Flow:** -recon precomputed -> extract facts from provided context -> curate with UPSERT -> verify applied file paths - -**Timestamp:** 2026-05-21T10:15:53.911Z - -**Author:** ByteRover context engineer - -## Narrative - -### Structure - -This entry records the curation run instructions and execution constraints for a single-pass RLM workflow. - -### Dependencies - -Depends on the precomputed recon result and the provided context/history/metadata variables. - -### Highlights - -The context explicitly instructs not to print raw context, not to call tools.curation.recon again, and to verify via result.applied[].filePath. - -### Rules - -IMPORTANT: Do NOT print raw context. Do NOT call tools.curation.recon — it has been pre-computed. Proceed directly to extraction. IMPORTANT: Any code_exec call containing mapExtract MUST use timeout: 300000 on the code_exec tool call itself (not inside mapExtract options). Use tools.curation.groupBySubject() and tools.curation.dedup() to organize extractions. Verify via result.applied[].filePath — do NOT call readFile for verification. diff --git a/.brv/context-tree/facts/project/task_6_spec_review_after_envelope_fix.md b/.brv/context-tree/facts/project/task_6_spec_review_after_envelope_fix.md index f35150c..bec95dc 100644 --- a/.brv/context-tree/facts/project/task_6_spec_review_after_envelope_fix.md +++ b/.brv/context-tree/facts/project/task_6_spec_review_after_envelope_fix.md @@ -2,7 +2,7 @@ title: Task 6 Spec Review After Envelope Fix summary: 'Task 6 review approved: CLI and dispatch align on { caplet, request }, config path handling remains local-only, and tests cover remote control behavior.' tags: [] -related: [architecture/remote_control/remote_control_api_shape.md, architecture/remote_control/task_1_spec_compliance_review.md, architecture/remote_control/cli_remote_mode_selection.md] +related: [architecture/remote_control/remote_control_api_shape.md, architecture/remote_control/task_1_spec_compliance_review.md, architecture/remote_control/cli_remote_mode_selection.md, facts/conventions/task_3_spec_review_fix.md, facts/conventions/task_5_regression_test_update.md, facts/conventions/task_6_review_outcome.md, facts/conventions/task_7_review_outcome.md, facts/conventions/task_7_remote_mutation_routing_review.md, facts/conventions/task_9_remote_config_test_fix.md] keywords: [] createdAt: '2026-05-20T14:11:18.102Z' updatedAt: '2026-05-20T14:11:18.102Z' diff --git a/.brv/context-tree/project/pr_78_review_outcome/pr_78_review_outcome.md b/.brv/context-tree/project/pr_78_review_outcome/pr_78_review_outcome.md index 63acb70..15a4651 100644 --- a/.brv/context-tree/project/pr_78_review_outcome/pr_78_review_outcome.md +++ b/.brv/context-tree/project/pr_78_review_outcome/pr_78_review_outcome.md @@ -2,7 +2,7 @@ title: PR 78 Review Outcome summary: 'PR #78 had zero unresolved review threads and zero unresolved outside-diff threads; no code fixes were needed, the .brv memory update was preserved, pushed as commit c41d191, and pnpm verify passed.' tags: [] -related: [] +related: [project/rlm_curation_workflow/context.md, project/rlm_curation_workflow/rlm_curation_workflow.md] keywords: [] createdAt: '2026-05-24T15:30:07.506Z' updatedAt: '2026-05-24T15:30:07.507Z' diff --git a/.brv/context-tree/project/rlm_curation_workflow/context.md b/.brv/context-tree/project/rlm_curation_workflow/context.md index 6df80bb..d8a60b6 100644 --- a/.brv/context-tree/project/rlm_curation_workflow/context.md +++ b/.brv/context-tree/project/rlm_curation_workflow/context.md @@ -1,3 +1,6 @@ +--- +related: [project/pr_78_review_outcome/pr_78_review_outcome.md] +--- # Topic: rlm_curation_workflow ## Overview diff --git a/.brv/context-tree/project/rlm_curation_workflow/current_branch_completion_restore.md b/.brv/context-tree/project/rlm_curation_workflow/current_branch_completion_restore.md deleted file mode 100644 index 9df787a..0000000 --- a/.brv/context-tree/project/rlm_curation_workflow/current_branch_completion_restore.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Current Branch Completion Restore -summary: Restored split-target CLI completion support, preserved dotted targets, updated docs and changeset, and verified with full test and lint passes. -tags: [] -related: [] -keywords: [] -createdAt: '2026-05-22T10:07:36.953Z' -updatedAt: '2026-05-22T10:07:36.953Z' ---- -## Reason -Document the branch-local reimplementation and verification outcomes for split completion and tool/prompt target handling - -## Raw Concept -**Task:** -Document the current-branch restoration of split completion behavior and verification - -**Changes:** -- Reimplemented completion in the current branch -- Restored split target handling for get-tool, call-tool, and get-prompt -- Preserved dotted completion compatibility -- Added regression coverage for split and dotted completion paths -- Updated documentation and changelog entry - -**Files:** -- pnpm format:check -- pnpm lint -- pnpm verify -- .changeset/local-completion-split-tools.md -- completion spec - -**Flow:** -current branch -> restore implementation -> add regression tests -> update docs -> run focused tests -> run formatting/lint/verify - -**Timestamp:** 2026-05-22T10:07:13.860Z - -**Author:** assistant - -## Narrative -### Structure -This entry captures the branch-local completion restoration, the affected CLI target forms, the documentation updates, and the verification results. - -### Dependencies -The change depended on the existing CLI completion engine and on tests covering split and dotted forms. - -### Highlights -The implementation restored split-target support while keeping legacy dotted targets working, and the full verification gate passed. - -### Rules -Only pre-existing unrelated .brv remains dirty alongside the implementation files. - -## Facts -- **branch_location**: The work was implemented in the current branch at /home/ianpascoe/code/caplets instead of the previous worktree. [project] -- **completion_implementation**: Local hidden __complete now uses CapletsEngine.completeCliWords. [project] -- **split_target_support**: get-tool, call-tool, and get-prompt accept split targets. [project] -- **dotted_target_support**: Existing dotted targets remain supported. [project] -- **completion_suggestions**: Completion suggests split-form backend IDs and unqualified tool/prompt names while preserving dotted completion. [project] -- **regression_tests**: Regression tests were added for split tool calls, split prompt calls, split/dotted completion, and local OpenAPI completion discovery. [project] -- **documentation_updates**: README, completion spec, and .changeset/local-completion-split-tools.md were updated. [project] -- **focused_test_result**: pnpm --filter @caplets/core test -- test/cli-completion.test.ts test/cli.test.ts passed with 456 tests. [project] -- **format_check**: pnpm format:check passed. [project] -- **lint_check**: pnpm lint passed. [project] -- **verify_result**: pnpm verify passed fully with 39 test files and 536 tests. [project] -- **dirty_worktree_note**: Only pre-existing unrelated .brv remained dirty alongside the implementation files. [project] diff --git a/.brv/context-tree/project/rlm_curation_workflow/rlm_curation_workflow.md b/.brv/context-tree/project/rlm_curation_workflow/rlm_curation_workflow.md index ce4e61a..5154a32 100644 --- a/.brv/context-tree/project/rlm_curation_workflow/rlm_curation_workflow.md +++ b/.brv/context-tree/project/rlm_curation_workflow/rlm_curation_workflow.md @@ -1,99 +1,66 @@ --- -title: RLM Curation Workflow -summary: RLM curation workflow uses recon-first analysis, single-pass extraction for small contexts, optional chunked mapExtract for larger contexts, UPSERT-based curation, and verification through applied file paths and result summaries. -tags: [] -related: [facts/conventions/context.md] -keywords: [] -createdAt: '2026-05-22T10:24:48.339Z' -updatedAt: '2026-05-22T10:45:13.936Z' +consolidated_at: '2026-05-25T11:38:47.792Z' +consolidated_from: [{date: '2026-05-25T11:38:47.792Z', path: project/rlm_curation_workflow/current_branch_completion_restore.md, reason: 'These two files substantially overlap on the RLM curation workflow and completion behavior guidance. The latter is the richer and more complete source, while the branch restore note includes implementation-specific completion details and verification outcomes that fit naturally into the workflow topic; combining them will reduce duplication and keep one canonical workflow record.'}] +related: [project/pr_78_review_outcome/pr_78_review_outcome.md] --- -## Reason -Document the RLM curation approach, runtime constraints, and verification rules from the current context. - -## Raw Concept -**Task:** -Curate the RLM curation workflow and runtime guidance. - -**Changes:** -- Use precomputed recon output to select single-pass mode -- Proceed directly to extraction when single-pass is suggested -- Verify curation through applied file paths and summary status -- Reinforced single-pass handling when recon suggests single-pass mode -- Captured the requirement to avoid printing raw context -- Captured extraction and verification requirements for curation runs -- Captured the agreed completion behavior for call-tool, get-tool, and get-prompt -- Recorded that call-tool completions distinguish backend IDs from tool names based on prefix -- Recorded that failures and timeouts must degrade to safe fallbacks without surfacing errors -- Followed the RLM workflow without recomputing recon -- Applied single-pass curation for a small context -- Captured verification requirements and execution constraints -- Use precomputed recon results and proceed directly to extraction when suggestedMode is single-pass -- Use mapExtract only for chunked extraction when needed -- Use dedup and groupBySubject to organize extracted facts -- Verify curation via result.applied[].filePath without readFile -- Defined the single-pass path after recon. -- Captured the timeout requirement for mapExtract calls. -- Captured verification guidance using applied file paths. -- Use precomputed recon when available and proceed directly to extraction for single-pass contexts -- Use mapExtract only for chunked extraction when suggested by recon -- Verify curation via result.applied[].filePath instead of readFile -- Opened PR #74 for fix/cli-completions. -- Used main as the base branch. -- Confirmed verification succeeded via the push hook. -- Left unrelated local dirty files untouched. -- Captured recon-first workflow guidance for curation. -- Recorded single-pass and chunked extraction decision rules. -- Preserved verification and timeout requirements for mapExtract usage. - -**Files:** -- caplets/github-cli/CAPLET.md -- caplets/repo-cli/CAPLET.md -- caplets/context7.md -- .brv -- .opencode/opencode.json - -**Flow:** -recon -> choose single-pass or chunked extraction -> dedup/group facts -> curate -> verify applied file paths - -**Timestamp:** 2026-05-22T10:45:06.051Z - -**Author:** ByteRover context engineer - -## Narrative -### Structure -This knowledge describes how to curate context using the RLM workflow, including when to skip chunking, how to extract facts, and how to validate results after curation. - -### Dependencies -Depends on recon output, the curate tool, and optional mapExtract for larger contexts. - -### Highlights -The context emphasizes a single-pass path for compact inputs and requires explicit verification from curate results rather than rereading files. - -### Rules -IMPORTANT: Do NOT print raw context. Do NOT call tools.curation.recon — it has been pre-computed. Proceed directly to extraction. For chunked extraction use tools.curation.mapExtract(). Pass taskId as a bare variable, not a string. Any code_exec call containing mapExtract MUST use timeout: 300000 on the code_exec tool call itself (not inside mapExtract options). Verify via result.applied[].filePath — do NOT call readFile for verification. - -### Examples -Opened PR: https://github.com/spiritledsoftware/caplets/pull/74 +# Title: RLM Curation Workflow + +## Overview +Covers the curation workflow for this session, the completion behavior contract for caplets commands, and the branch-local restoration of split-target CLI completion support. + +## Key Concepts +- single-pass +- chunked extraction +- recon-first analysis +- completion contract +- call-tool +- get-tool +- get-prompt +- safe fallback behavior +- split target support +- dotted target compatibility +- regression tests +- verification via applied file paths + +## Workflow / Rules +- Use precomputed recon output to select single-pass mode. +- Proceed directly to extraction when single-pass is suggested. +- Use mapExtract only for chunked extraction when needed. +- Pass taskId as a bare variable, not a string. +- Any code_exec call containing mapExtract MUST use timeout: 300000 on the code_exec tool call itself. +- Verify curation via result.applied[].filePath; do not reread files for verification. +- Do not print raw context. +- Completion behavior for call-tool, get-tool, and get-prompt must distinguish backend IDs from tool names based on prefix. +- Failures and timeouts must degrade to safe fallbacks without surfacing errors. +- Local hidden __complete now uses CapletsEngine.completeCliWords. + +## Highlights +- For small contexts, single-pass curation is the preferred path after recon. +- For larger contexts, chunked extraction should be followed by dedup and groupBySubject before curation. +- Split targets for get-tool, call-tool, and get-prompt were restored while preserving dotted completion compatibility. +- Regression tests were added for split tool calls, split prompt calls, split/dotted completion, and local OpenAPI completion discovery. +- Verification passed with focused tests, formatting, lint, and full pnpm verify. ## Facts - **curation_mode**: Single-pass mode should be used when recon suggests single-pass. [convention] - **mapextract_taskid**: When using mapExtract in curation, the taskId must be passed as a bare variable. [convention] - **mapextract_timeout**: Any code_exec call containing mapExtract must use timeout: 300000 on the code_exec tool call itself. [convention] - **verification_method**: Verification should use result.applied[].filePath and should not call readFile for verification. [convention] - ---- - -title: RLM Curation Workflow -summary: RLM curation workflow for small contexts and runtime conventions: recon-first, single-pass when suggested, use mapExtract for chunked contexts, dedup/groupBySubject, and verify via applied file paths or curate result status. -tags: [] -related: [project/rlm_curation_workflow/context.md, facts/conventions/task_7_remote_mutation_routing_review.md, facts/project/rlm_curation_workflow.md] -keywords: [] -createdAt: '2026-05-21T16:05:21.915Z' -updatedAt: '2026-05-21T17:56:16.143Z' - ---- +- **branch_location**: The work was implemented in the current branch at /home/ianpascoe/code/caplets instead of the previous worktree. [project] +- **completion_implementation**: Local hidden __complete now uses CapletsEngine.completeCliWords. [project] +- **split_target_support**: get-tool, call-tool, and get-prompt accept split targets. [project] +- **dotted_target_support**: Existing dotted targets remain supported. [project] +- **completion_suggestions**: Completion suggests split-form backend IDs and unqualified tool/prompt names while preserving dotted completion. [project] +- **regression_tests**: Regression tests were added for split tool calls, split prompt calls, split/dotted completion, and local OpenAPI completion discovery. [project] +- **documentation_updates**: README, completion spec, and .changeset/local-completion-split-tools.md were updated. [project] +- **focused_test_result**: pnpm --filter @caplets/core test -- test/cli-completion.test.ts test/cli.test.ts passed with 456 tests. [project] +- **format_check**: pnpm format:check passed. [project] +- **lint_check**: pnpm lint passed. [project] +- **verify_result**: pnpm verify passed fully with 39 test files and 536 tests. [project] +- **dirty_worktree_note**: Only pre-existing unrelated .brv remained dirty alongside the implementation files. [project] ## Cross-References - project/rlm_curation_workflow/context.md - facts/conventions/task_7_remote_mutation_routing_review.md - facts/project/rlm_curation_workflow.md +- project/rlm_curation_workflow/current_branch_completion_restore.md \ No newline at end of file