Skip to content

Commit 78ce893

Browse files
authored
fix: respect brvPath parameter and add high-value tests (vitest) (#7)
* fix: respect brv path parameter and tests * chore: changeset
1 parent 5a0860d commit 78ce893

12 files changed

Lines changed: 834 additions & 48 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Conversation fragment pending completion
3+
summary: Partial user note indicates they fixed something, but the snippet is incomplete and does not provide enough durable detail to retain more specifically.
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T17:08:40.091Z'
8+
updatedAt: '2026-04-24T17:08:40.091Z'
9+
---
10+
## Reason
11+
Capture available lasting-value context from partial conversation snippet.
12+
13+
## Raw Concept
14+
**Task:**
15+
Record the only durable information present in a truncated conversation snippet
16+
17+
**Changes:**
18+
- Noted that the source conversation was truncated before the substantive detail was visible
19+
20+
**Flow:**
21+
partial conversation -> assess durability -> store only verifiable fragment
22+
23+
**Timestamp:** 2026-04-24
24+
25+
## Narrative
26+
### Structure
27+
This entry reflects a truncated conversation context with no full substantive claim available for capture.
28+
29+
### Highlights
30+
Only the beginning of a user statement is visible, so no specific fix can be curated from the snippet alone.
31+
32+
## Facts
33+
- **conversation_fragment**: The available conversation snippet is incomplete and only shows the start of a user message: "I fixed". [other]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Repository Review Findings
3+
summary: A repository issue was fixed, but the provided context snippet is truncated and does not expose the specific file or change details.
4+
tags: []
5+
related: [release_management/ci/changesets_and_github_actions_ci.md, release_management/ci/husky_pre_commit_checks.md, release_management/ci/git_ignore_state_verification.md]
6+
keywords: []
7+
createdAt: '2026-04-24T17:04:26.153Z'
8+
updatedAt: '2026-04-24T17:08:41.497Z'
9+
---
10+
## Reason
11+
Curate the substantive fix noted in the conversation
12+
13+
## Raw Concept
14+
**Task:**
15+
Record a user-reported fix from a truncated conversation snippet
16+
17+
**Changes:**
18+
- Identified a brvPath passthrough bug in plugin construction
19+
- Confirmed the repository has no tests or pnpm test script
20+
- Noted tracked .brv/context-tree files in version control
21+
- Observed missing declaration files in the packed artifact
22+
- Recorded a moderate audit issue and outdated OpenCode dependencies
23+
- Flagged permissive numeric config validation
24+
- User stated that they fixed an issue
25+
26+
**Flow:**
27+
issue identified -> fix applied -> details omitted in available snippet
28+
29+
**Timestamp:** 2026-04-24
30+
31+
**Author:** user
32+
33+
## Narrative
34+
### Structure
35+
The available context only preserves the opening of the user message and does not include the remainder of the fix description.
36+
37+
### Dependencies
38+
Specific files, commands, or verification details are not present in the snippet.
39+
40+
### Highlights
41+
The message indicates a completed fix, but the exact subject of the fix is not recoverable from the supplied context.
42+
43+
### Rules
44+
Fix in this order: 1. Pass brvPath: config.brvPath into BrvBridge. 2. Add a small test suite and pnpm test. 3. Decide whether .brv/ should be fully untracked and ignored. 4. Add declaration generation plus types/exports metadata. 5. Refresh OpenCode dependencies and re-run pnpm audit. 6. Tighten config schema validation.
45+
46+
### Examples
47+
Verification commands passed: pnpm format:check, pnpm lint, pnpm typecheck, pnpm build, and pnpm pack --dry-run.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: High-Value Plugin Tests
3+
summary: High-value Vitest coverage for plugin behavior, plus a fix for default missing options handling.
4+
tags: []
5+
related: []
6+
keywords: []
7+
createdAt: '2026-04-24T17:15:40.250Z'
8+
updatedAt: '2026-04-24T17:15:40.250Z'
9+
---
10+
## Reason
11+
Document the implemented high-value tests and the bug fix they exposed.
12+
13+
## Raw Concept
14+
**Task:**
15+
Implement high-value tests for the plugin using observable hooks and minimal dependencies
16+
17+
**Changes:**
18+
- Added Vitest and pnpm test
19+
- Added src/index.test.ts with focused behavioral coverage
20+
- Fixed missing-options handling with Config.safeParse(options ?? {})
21+
22+
**Files:**
23+
- package.json
24+
- pnpm-lock.yaml
25+
- src/index.ts
26+
- src/index.test.ts
27+
- .github/workflows/ci.yml
28+
- .husky/pre-commit
29+
- README.md
30+
31+
**Flow:**
32+
test setup -> observable hook coverage -> bug discovery -> default-options fix -> verification
33+
34+
**Timestamp:** 2026-04-24
35+
36+
**Author:** assistant
37+
38+
## Narrative
39+
### Structure
40+
The work centers on public plugin hooks rather than internals, keeping the suite focused on observable behavior.
41+
42+
### Dependencies
43+
Relies on Vitest, mocked BrvBridge and OpenCode client behavior, and existing repo automation in CI and pre-commit hooks.
44+
45+
### Highlights
46+
The tests validated config passthrough, recall behavior, curation dedupe, and error-path logging, and they surfaced a real default-configuration bug.
47+
48+
### Rules
49+
Only high-value tests were added; avoid extracting internals when public hooks can verify behavior.
50+
51+
### Examples
52+
One test confirms that missing options no longer prevent hook creation because the plugin now safely defaults to an empty config object.
53+
54+
## Facts
55+
- **test_runner**: The work added Vitest as the smallest test runner dependency. [project]
56+
- **test_script**: A new pnpm test script was added. [project]
57+
- **test_coverage**: The test suite covers bridge config passthrough, recall filtering/truncation/injection, idle curation dedupe, and invalid config logging/no hooks. [project]
58+
- **default_options_fix**: ByteroverPlugin now treats missing plugin options as {} via Config.safeParse(options ?? {}). [project]
59+
- **verification_commands**: Verification passed for pnpm test, pnpm format:check, pnpm lint, pnpm typecheck, and pnpm build. [project]
60+
- **audit_advisory**: pnpm audit still reports an existing moderate uuid advisory through @opencode-ai/plugin > effect > uuid. [project]

.changeset/legal-onions-drive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"opencode-byterover": patch
3+
---
4+
5+
Respect `brvPath` parameter and add high-value tests (vitest)

.github/FUNDING.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1 @@
1-
# These are supported funding model platforms
2-
3-
github: [ian-pascoe] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12-
polar: # Replace with a single Polar username
13-
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14-
thanks_dev: # Replace with a single thanks.dev username
15-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1+
github: ian-pascoe

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@ jobs:
4343
- name: Typecheck
4444
run: pnpm typecheck
4545

46+
- name: Test
47+
run: pnpm test
48+
4649
- name: Build
4750
run: pnpm build

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pnpm format:check
22
pnpm lint
3+
pnpm test
34
pnpm typecheck

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The plugin accepts these optional settings:
5151
pnpm install
5252
pnpm format:check
5353
pnpm lint
54+
pnpm test
5455
pnpm typecheck
5556
pnpm build
5657
```

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
"lint": "oxlint",
3131
"lint:fix": "oxlint --fix",
3232
"release": "pnpm run build && changeset publish",
33+
"test": "vitest run",
3334
"typecheck": "tsc --noEmit",
3435
"version-packages": "changeset version",
3536
"prepare": "husky"
3637
},
3738
"dependencies": {
3839
"@byterover/brv-bridge": "^1.1.0",
39-
"@opencode-ai/plugin": "^1.14.22",
40-
"@opencode-ai/sdk": "^1.14.22",
40+
"@opencode-ai/plugin": "^1.14.24",
41+
"@opencode-ai/sdk": "^1.14.24",
4142
"zod": "^4.3.6"
4243
},
4344
"devDependencies": {
@@ -48,7 +49,8 @@
4849
"oxfmt": "^0.46.0",
4950
"oxlint": "^1.61.0",
5051
"rolldown": "1.0.0-rc.17",
51-
"typescript": "^6.0.3"
52+
"typescript": "^6.0.3",
53+
"vitest": "^4.1.5"
5254
},
5355
"packageManager": "pnpm@10.33.2"
5456
}

0 commit comments

Comments
 (0)