-
Notifications
You must be signed in to change notification settings - Fork 9
feat: scaffold DCP config in replicator init and add doctor check #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
318fb31
feat: scaffold DCP config in replicator init and add doctor check
jflowers 4962d4f
fix(agentkit): align ScaffoldResult.Action value and docs to "overwri…
jflowers e3a04cf
fix(doctor): surface file read errors in DCP config check
jflowers 1757430
test(doctor): add test for unreadable command file warn path
jflowers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.uf/dewey/learnings/add-dcp-config-20260816T183957-jay-flowers.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| tag: add-dcp-config | ||
| author: jay-flowers | ||
| category: gotcha | ||
| created_at: 2026-08-16T18:39:57Z | ||
| identity: add-dcp-config-20260816T183957-jay-flowers | ||
| tier: draft | ||
| --- | ||
|
|
||
| When adding new code to an existing file like internal/doctor/checks.go, always check if the new code follows the convention pack rules even if the existing code in the same file doesn't. In the add-dcp-config change, the checkDCPConfig() function initially used string concatenation for filesystem paths (projectDir + "/.opencode/commands") because the existing checkConfigDir() in the same file used the same pattern. All 5 review council agents flagged this as a SC-003 MUST violation — new code should use filepath.Join regardless of pre-existing patterns. The ScaffoldDCP() function in agentkit.go correctly used filepath.Join from the start, making the inconsistency within the same change more notable. Lesson: don't copy anti-patterns from existing code; follow the convention pack rules. |
10 changes: 10 additions & 0 deletions
10
.uf/dewey/learnings/add-dcp-config-20260816T184002-jay-flowers.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| tag: add-dcp-config | ||
| author: jay-flowers | ||
| category: gotcha | ||
| created_at: 2026-08-16T18:40:02Z | ||
| identity: add-dcp-config-20260816T184002-jay-flowers | ||
| tier: draft | ||
| --- | ||
|
|
||
| When fixing unchecked errors in test setup code (os.MkdirAll, os.WriteFile, os.ReadFile calls without error checking), apply the fix consistently across ALL test files touched by the change, not just the files where the new tests were added. In the add-dcp-config change, iteration 1 review found unchecked errors in agentkit_test.go and checks_test.go (new test code), but those fixes were not applied to pre-existing unchecked errors in init_test.go which was also modified by the change. The iteration 2 Testing reviewer caught this inconsistency and flagged it as HIGH severity. The pattern to follow: if err := os.MkdirAll(dir, 0o755); err != nil { t.Fatalf("setup MkdirAll: %v", err) } — wrap every setup call with t.Fatalf error checking. |
10 changes: 10 additions & 0 deletions
10
.uf/dewey/learnings/add-dcp-config-20260816T184006-jay-flowers.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| tag: add-dcp-config | ||
| author: jay-flowers | ||
| category: pattern | ||
| created_at: 2026-08-16T18:40:06Z | ||
| identity: add-dcp-config-20260816T184006-jay-flowers | ||
| tier: draft | ||
| --- | ||
|
|
||
| The doctor package's Run() function signature was extended from Run(store *db.Store, cfg *config.Config) to Run(store *db.Store, cfg *config.Config, projectDir string) to support per-project checks like checkDCPConfig. The key design decision (D9) was to accept an explicit directory parameter rather than calling os.Getwd() inside the check function. This enables test isolation with t.TempDir() — tests pass a temp directory directly instead of needing unsafe os.Chdir() calls. The os.Getwd() call lives in the CLI layer (cmd/replicator/doctor.go) where it's the caller's responsibility. This pattern should be followed for any future per-project doctor checks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.