Skip to content

Commit 4f6affc

Browse files
authored
feat: add more ByteRover config options (#11)
* feat: more config options * docs: add npm badge and align config defaults * docs: commit byterover context tree updates * docs: byterover * docs: AGENTS.md
1 parent 2f87c32 commit 4f6affc

22 files changed

Lines changed: 1018 additions & 48 deletions
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: BRV Context Tree Files Must Be Committed
3+
summary: The repository convention is that .brv/context-tree files should always be committed, and they were committed in a docs-scoped commit.
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T18:51:04.126Z'
8+
updatedAt: '2026-04-24T18:52:22.543Z'
9+
---
10+
## Reason
11+
Capture repository convention and commit outcome for durable recall
12+
13+
## Raw Concept
14+
**Task:**
15+
Document the repository convention that .brv/context-tree files must be committed and record the related docs commit outcome
16+
17+
**Changes:**
18+
- Established that .brv context-tree files are part of committed repository state
19+
- Established that .brv/context-tree files are always committed
20+
- Recorded the docs-scoped commit used for the context-tree update
21+
- Captured verification results and PR branch information
22+
23+
**Flow:**
24+
User instruction -> commit .brv/context-tree files -> verify hooks/tests -> push to PR branch
25+
26+
**Timestamp:** 2026-04-24
27+
28+
**Author:** user
29+
30+
## Narrative
31+
### Structure
32+
This knowledge belongs in the conventions domain because it defines a repository workflow rule. It also preserves the commit outcome and verification state associated with that rule.
33+
34+
### Dependencies
35+
Depends on the repository practice of treating .brv/context-tree content as committed knowledge rather than transient chat context.
36+
37+
### Highlights
38+
The stated convention explicitly overrides any conflicting note that says not to stage .brv/context-tree files. The recorded commit passed pre-commit verification and left the working tree clean.
39+
40+
### Rules
41+
“.brv context-tree files should always be committed. just put it under a `docs:` commit”
42+
43+
## Facts
44+
- **brv_context_tree_commit_policy**: .brv/context-tree files should always be committed [convention]
45+
- **brv_context_tree_commit_type**: The .brv/context-tree files were committed in a docs: commit [project]
46+
- **brv_context_tree_commit_hash**: The commit recorded for the .brv/context-tree updates was a7e757b docs: commit byterover context tree updates [project]
47+
- **pr_branch**: The updated PR branch is https://github.com/ian-pascoe/opencode-byterover/pull/11 [project]
48+
- **pre_commit_verification**: Pre-commit verification passed pnpm format:check, pnpm lint, pnpm test, and pnpm typecheck [project]
49+
- **working_tree_status**: The working tree was clean after the commit was pushed [project]
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: Agents Md Repository Guidance
3+
summary: Repository guidance for AGENTS.md covers verified commands, entrypoints, ByteRover state handling, CI/hook order differences, and release workflow conventions.
4+
tags: []
5+
related: [release_management/ci/changesets_and_github_actions_ci.md, release_management/ci/husky_pre_commit_checks.md, facts/project/context.md]
6+
keywords: []
7+
createdAt: '2026-04-24T18:54:58.460Z'
8+
updatedAt: '2026-04-24T18:56:11.897Z'
9+
---
10+
## Reason
11+
Preserve the verified repo-specific AGENTS.md guidance created for future OpenCode sessions
12+
13+
## Raw Concept
14+
**Task:**
15+
Document compact repo-specific guidance for future OpenCode sessions
16+
17+
**Changes:**
18+
- Defined the investigation order for repo sources
19+
- Specified what AGENTS.md should include and exclude
20+
- Established in-place editing for an existing AGENTS.md
21+
- Prioritize README, manifests, workspace config, lockfiles, CI, pre-commit, task runner config, and repo-local instruction files as investigation sources
22+
- Use executable sources of truth over prose when conflicts appear
23+
- Keep AGENTS.md compact and high-signal, focused on durable repo-specific guidance
24+
- Captured verified package manager, Node targets, and entrypoints
25+
- Recorded test runner and focused verification guidance
26+
- Recorded generated/local state directories and release workflow conventions
27+
- Captured the mismatch between Husky pre-commit order and CI order
28+
29+
**Files:**
30+
- README.md
31+
- package.json
32+
- pnpm-workspace.yaml
33+
- pnpm-lock.yaml
34+
- rolldown.config.ts
35+
- tsconfig.json
36+
- .github/workflows/ci.yml
37+
- .husky/pre-commit
38+
- .opencode/opencode.jsonc
39+
- AGENTS.md
40+
- .opencode/package.json
41+
- src/index.ts
42+
- src/index.test.ts
43+
- .changeset/config.json
44+
45+
**Flow:**
46+
investigate executable sources -> verify repo conventions -> curate durable guidance
47+
48+
**Timestamp:** 2026-04-24
49+
50+
**Author:** User instruction
51+
52+
## Narrative
53+
### Structure
54+
The guidance is intentionally compact and focused on non-obvious repository behavior that future agents could miss.
55+
56+
### Dependencies
57+
It draws from root manifests, CI workflow, Husky hook, entrypoint files, and changeset configuration.
58+
59+
### Highlights
60+
The most important workflow detail is that Husky and CI run checks in different orders; the guidance preserves both instead of assuming one canonical sequence.
61+
62+
### Rules
63+
Include only high-signal, repo-specific guidance such as exact commands and shortcuts the agent would otherwise guess wrong; architecture notes that are not obvious from filenames; conventions that differ from language or framework defaults; setup requirements, environment quirks, and operational gotchas; references to existing instruction sources that matter. Exclude generic software advice, long tutorials, exhaustive file trees, obvious language conventions, speculative claims, and content better stored in another file referenced via `opencode.json` instructions.
64+
65+
## Facts
66+
- **package_manager**: The repository uses pnpm as the package manager. [project]
67+
- **node_versions**: The project targets Node 22 in CI and uses Node 24 in the local package config. [project]
68+
- **entrypoints**: The plugin entrypoints are src/index.ts and src/index.test.ts. [project]
69+
- **test_runner**: The repository uses Vitest for testing. [project]
70+
- **state_directories**: The repository keeps generated and local state in dist/, .brv/, and .changeset/. [project]
71+
- **pre_commit_order**: Husky pre-commit runs format:check, lint, test, and typecheck in that order. [project]
72+
- **ci_order**: CI runs format:check, lint, typecheck, test, and build in that order. [project]
73+
- **release_workflow**: The repo relies on changesets for release workflow conventions. [project]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Byterover Context Availability
3+
summary: The assistant confirmed it can see the full <byterover-context> block in the conversation, including all 5 topics in detail.
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T18:26:16.489Z'
8+
updatedAt: '2026-04-24T18:26:16.489Z'
9+
---
10+
## Reason
11+
Record that the assistant can see the full byterover-context block in conversation when present.
12+
13+
## Raw Concept
14+
**Task:**
15+
Document conversation context availability behavior
16+
17+
**Changes:**
18+
- Confirmed visibility of the full byterover-context block in conversation
19+
20+
**Flow:**
21+
user asks about visibility -> assistant confirms full context block is present
22+
23+
**Timestamp:** 2026-04-24
24+
25+
**Author:** assistant
26+
27+
## Narrative
28+
### Structure
29+
A short exchange where the user asks whether the long conversation block is visible and the assistant confirms it is.
30+
31+
### Highlights
32+
The assistant explicitly states that the full <byterover-context> block is present and visible, and that the block contains all 5 topics in detail.
33+
34+
## Facts
35+
- **byterover_context_availability**: The assistant can see the full <byterover-context> block in the conversation when it is present. [project]
36+
- **byterover_context_topics**: The conversation included a full <byterover-context> block with all 5 topics in detail. [project]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: ByteRover recall query echo fix
3+
summary: ByteRover recall responses are sanitized by stripping only the echoed query from the Summary header; tests, lint, typecheck, and build all passed.
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T18:13:13.757Z'
8+
updatedAt: '2026-04-24T18:13:13.757Z'
9+
---
10+
## Reason
11+
Document the durable code change that strips echoed recall queries from ByteRover summaries while preserving retrieved context.
12+
13+
## Raw Concept
14+
**Task:**
15+
Strip echoed ByteRover recall queries from formatted responses without removing the retrieved context.
16+
17+
**Changes:**
18+
- Added stripEchoedRecallQuery(content, query) in src/index.ts
19+
- Added regression coverage in src/index.test.ts
20+
- Fixed a test harness gap by mocking tui.showToast so setup warnings do not crash tests
21+
22+
**Files:**
23+
- src/index.ts
24+
- src/index.test.ts
25+
26+
**Flow:**
27+
recall query -> ByteRover response -> sanitize summary header -> preserve details/sources/gaps -> push into system
28+
29+
**Author:** assistant
30+
31+
## Narrative
32+
### Structure
33+
The fix is intentionally narrow: it targets only the echoed query fragment inside the ByteRover Summary header and leaves the rest of the response intact.
34+
35+
### Dependencies
36+
The test suite uses a mocked brvBridge.recall path, so the behavior is covered without contacting ByteRover directly.
37+
38+
### Highlights
39+
Verification succeeded across targeted tests and repository-wide checks, confirming the sanitizer did not break formatting or type safety.
40+
41+
### Examples
42+
The preserved response sections include **Summary**, **Details**, **Sources**, and **Gaps**.
43+
44+
## Facts
45+
- **recall_query_sanitizer**: The project added stripEchoedRecallQuery(content, query) in src/index.ts to remove only the echoed recall query from ByteRover summary headers. [project]
46+
- **recall_query_sanitization_scope**: The sanitizer removes only the ` for "<full recall query>"` portion from a ByteRover `**Summary**: Found ...` header and preserves the rest of the returned context. [project]
47+
- **recall_query_regression_test**: A regression test was added in src/index.test.ts that simulates ByteRover echoing the full recall query. [project]
48+
- **verification_commands**: Repository verification passed with pnpm test -- src/index.test.ts, pnpm format:check, pnpm lint, pnpm typecheck, pnpm test, and pnpm build. [project]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Byterover recall query echo issue
3+
summary: Recall results echo the full instruction/conversation because brvBridge.recall is called with the entire formatted prompt; fix by using a concise query and optionally stripping ByteRover boilerplate before injection.
4+
tags: []
5+
related: [facts/project/injected_byterover_context_availability.md]
6+
keywords: []
7+
createdAt: '2026-04-24T18:05:09.757Z'
8+
updatedAt: '2026-04-24T18:05:09.757Z'
9+
---
10+
## Reason
11+
Document the cause of query and conversation echo in recall results from src/index.ts
12+
13+
## Raw Concept
14+
**Task:**
15+
Explain why query and conversation text appears in recall results in src/index.ts and document the relevant implementation details.
16+
17+
**Changes:**
18+
- Identified that brvBridge.recall is passed a multiline prompt containing instructions and recent conversation
19+
- Observed that recall content is injected back into system messages via <byterover-context>
20+
- Noted that future recall requests can include previously injected context
21+
22+
**Files:**
23+
- src/index.ts
24+
25+
**Flow:**
26+
session.idle or session.compacting -> curateTurn -> brvBridge.persist; system.transform -> fetchMessagesForRecall -> brvBridge.recall -> system.push(<byterover-context>)
27+
28+
**Timestamp:** 2026-04-24
29+
30+
**Author:** ByteRover context engineer
31+
32+
## Narrative
33+
### Structure
34+
The plugin curates conversation turns when a session idles or compacts, then recalls context during system transform by fetching recent messages and pushing recalled content into the system prompt.
35+
36+
### Dependencies
37+
Relies on BrvBridge recall/persist behavior and the session message history returned by client.session.messages.
38+
39+
### Highlights
40+
The root cause is query construction: the recall API receives the full instruction block and recent conversation rather than a narrow search query. A secondary mitigation is sanitizing known ByteRover response boilerplate before injection.
41+
42+
### Rules
43+
Do not use the full formatted conversation as the recall query. Prefer a concise query derived from the latest user message. Strip known ByteRover boilerplate before pushing recalled content when needed.
44+
45+
### Examples
46+
Example problematic query text begins with: Recall any relevant context that would help answer the latest user message.
47+
Use the recent conversation only to resolve references and intent.
48+
Recent conversation:
49+
50+
---
51+
[user]...
52+
53+
## Facts
54+
- **byterover_recall_query**: ByteroverPlugin calls brvBridge.recall with the entire recall instruction plus recent conversation as the query string. [project]
55+
- **byterover_recall_output**: The recall output can echo ByteRover boilerplate such as Summary, Details, Sources, and Gaps into the injected system context. [project]
56+
- **byterover_recall_feedback_loop**: A feedback loop can occur because injected <byterover-context> content becomes part of future session history and can be included in later recall queries. [project]
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Configurable Recall and Persist Prompts
3+
summary: Recall and persist instruction text can be overridden via config fields while preserving existing message formatting and <byterover-context> injection behavior.
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T18:27:49.316Z'
8+
updatedAt: '2026-04-24T18:27:49.316Z'
9+
---
10+
## Reason
11+
Document configurable prompt overrides for recall and persist flows
12+
13+
## Raw Concept
14+
**Task:**
15+
Document making recall and persist prompts configurable through config options
16+
17+
**Changes:**
18+
- Add optional config fields recallPrompt and persistPrompt
19+
- Use default hardcoded prompt text when config overrides are absent
20+
- Apply recallPrompt in brvBridge.recall
21+
- Apply persistPrompt in brvBridge.persist
22+
23+
**Flow:**
24+
config options -> choose override or default prompt -> assemble instruction block -> formatted conversation messages
25+
26+
**Timestamp:** 2026-04-24
27+
28+
## Narrative
29+
### Structure
30+
Two optional config fields override the instruction text for recall and persist paths without changing message formatting.
31+
32+
### Dependencies
33+
The prompt assembly must continue to use the existing conversation formatting and <byterover-context> injection behavior.
34+
35+
### Highlights
36+
Defaults remain unchanged for existing users, and tests should cover default behavior plus custom recallPrompt and persistPrompt usage.
37+
38+
## Facts
39+
- **prompt_configurability**: The recall prompt and persist prompt should be configurable via config options. [project]
40+
- **prompt_override_scope**: Custom prompt values override only the instruction text. [project]
41+
- **conversation_formatting**: Existing conversation formatting must be preserved. [project]
42+
- **byterover_context_injection**: The <byterover-context> injection behavior must be preserved. [project]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Topic: project
2+
3+
## Overview
4+
Covers the handling of ByteRover recall responses, specifically sanitizing echoed query text before the result is injected into the system.
5+
6+
## Key Concepts
7+
- ByteRover recall
8+
- summary-header sanitization
9+
- regression testing
10+
- test harness mocking
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Context Tree Commit Policy
3+
summary: .brv context-tree files should always be committed
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T18:50:56.318Z'
8+
updatedAt: '2026-04-24T18:50:56.318Z'
9+
---
10+
## Reason
11+
Capture durable repository convention from user instruction
12+
13+
## Raw Concept
14+
**Task:**
15+
Document repository policy for .brv context-tree files
16+
17+
**Changes:**
18+
- Established that .brv context-tree files must always be committed
19+
20+
**Flow:**
21+
edit context-tree files -> commit changes
22+
23+
**Timestamp:** 2026-04-24
24+
25+
## Narrative
26+
### Structure
27+
Repository workflow includes committing updates to the .brv context-tree alongside relevant changes.
28+
29+
### Highlights
30+
The user explicitly stated that .brv context-tree files should always be committed.
31+
32+
## Facts
33+
- **context_tree_commit_policy**: .brv context-tree files should always be committed [convention]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Conversation Context Quoting Boundary
3+
summary: The assistant refuses to quote hidden or injected system/developer context verbatim and instead offers a concise summary or answers about its contents.
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T18:19:05.394Z'
8+
updatedAt: '2026-04-24T18:19:05.395Z'
9+
---
10+
## Reason
11+
Capture the assistant boundary on hidden or injected context quoting
12+
13+
## Raw Concept
14+
**Task:**
15+
Document the assistant boundary around quoting hidden or injected context
16+
17+
**Changes:**
18+
- Recorded refusal to quote hidden or injected system/developer context verbatim
19+
20+
**Flow:**
21+
user asks for quoting -> assistant refuses verbatim quote -> offers summary or targeted answer
22+
23+
**Timestamp:** 2026-04-24T18:19:00.852Z
24+
25+
## Narrative
26+
### Structure
27+
A brief conversation note capturing the assistant’s policy boundary on hidden/injected context.
28+
29+
### Highlights
30+
The assistant explicitly offers concise summaries or specific answers instead of verbatim quotation.
31+
32+
## Facts
33+
- **context_quoting_boundary**: The assistant cannot quote hidden or injected system/developer context verbatim, even when it is visible to it. [project]

0 commit comments

Comments
 (0)