chore: fix existing CI drift (biome format + typecheck)#72
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates repository targeting/preset-related flows and config typing, along with broad formatting/consistency changes across orchestrators and tests.
Changes:
- Align tests/config fixtures with
repositoryTargetingand new config shape (e.g., scoring in init tests). - Refactor/format orchestration and content rendering code for readability; remove unused analyze selection helpers.
- Tighten typing around LLM provider profile secret redaction/restoration.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/scout-targeting.test.ts | Reformat spies/expectations for readability. |
| test/preset-orchestrator.test.ts | Reformat preset setup and expectation blocks. |
| test/machine-commands.test.ts | Add repositoryTargeting to mocked config/snapshots. |
| test/machine-agent.test.ts | Add repositoryTargeting to test config factory. |
| test/init-orchestrator.test.ts | Update init expectations for scoring + preset prompting and formatting. |
| test/doctor.test.ts | Reformat preset targeting inspection test cases. |
| test/agent-run.test.ts | Adjust config merge order + reformat long assertion. |
| test/agent-orchestrator.test.ts | Add repositoryTargeting to config + tweak scout invocation. |
| src/services/repository-targeting.ts | Reformat error/return types for clarity. |
| src/services/index.ts | Reorder export list for ResolvedRepositoryScope. |
| src/services/content.ts | Simplify array construction and reformat suggestion flattening. |
| src/orchestration/preset.ts | Reformat UI rendering and messaging. |
| src/orchestration/init.ts | Reformat key-values rendering lines; reorder import. |
| src/orchestration/config.ts | Introduce LLMProviderProfile typing for secret redact/restore. |
| src/orchestration/analyze.ts | Remove unused import/helpers; reformat candidate/group building. |
| src/orchestration/agent.ts | Reformat long expressions and UI payloads. |
| src/infra/config.ts | Reformat repository preset normalization. |
| src/commands/scout.ts | Inline action options type. |
| src/commands/preset.ts | Reformat command registration and required option configuration. |
| src/commands/index.ts | Reorder export list. |
Comments suppressed due to low confidence (1)
src/orchestration/config.ts:589
restoreProfileSecretsonly restores an existing secret when the imported profile explicitly containsapiKey: '<REDACTED>'. If an imported profile omitsapiKeyentirely (e.g., older export format or user-edited config), this will return the profile without an apiKey and can unintentionally wipe the stored secret on import. Consider also restoring fromexistingProfile.apiKeywhenp.apiKeyis missing/undefined (andexistingProfile.apiKeyexists), not only when it equals the redaction sentinel.
private redactProfileSecrets(profiles: Record<string, LLMProviderProfile>): Record<string, LLMProviderProfile> {
return Object.fromEntries(
Object.entries(profiles).map(([name, profile]) => [name, { ...profile, apiKey: '<REDACTED>' }]),
);
}
private restoreProfileSecrets(
imported: Record<string, unknown>,
existing: Record<string, LLMProviderProfile>,
): Record<string, LLMProviderProfile> {
return Object.fromEntries(
Object.entries(imported).map(([name, profile]) => {
const p = profile as LLMProviderProfile;
const existingProfile = existing[name];
if (p.apiKey === '<REDACTED>' && existingProfile?.apiKey) {
return [name, { ...p, apiKey: existingProfile.apiKey }];
}
return [name, p];
}),
);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Follow-up to the discussion thread in #68. Fixes the existing CI failures on
mainso thatbiome ciandbunx tsc --noEmitboth report zero errors. Split into three commits so each concern can be reviewed independently.Background
After #68 was merged, CI on
mainwas still red. A clean checkout reproduces both:bunx biome ci --linter-enabled=false src test index.ts package.json tsconfig.json→ 18 format / organize-imports errorsbunx tsc --noEmit→ 19 type errorsThe biome errors are pre-existing drift from the biome bump in #63 that never got a full reformat sweep. The typecheck errors are a mix of pre-existing drift (mostly test mocks not updated when
repositoryTargetingwas added in #58, and a few dead helpers inanalyze.ts) and two type leaks I introduced in #68 itself.Commits
1.
chore(format): apply biome to existing files(16 files)Pure mechanical output of
bunx biome check --write. No logic changes.src/...) — whitespace and import-order normalizationtest/...) — same2.
fix(config): align profile redact helpers with LLMProviderProfile type(1 file)Fixes the two type errors I introduced in #68 at
src/orchestration/config.ts:467and:538. The redact / restore helpers were typed asRecord<string, { apiKey?: string; [key: string]: unknown }>, which doesn't acceptRecord<string, LLMProviderProfile>becauseLLMProviderProfilelacks an index signature. Aligning the helpers to useLLMProviderProfiledirectly removes the impedance mismatch.3.
chore(types): clean up pre-existing typecheck drift(6 files)src/orchestration/analyze.ts— drop unusedparseGitHubRepoFullNameimport and two unused private methods (selectTopSuggestion,promptForSuggestion); both were superseded by candidate-based variants.test/agent-orchestrator.test.ts— addrepositoryTargetingto the localcreateConfigfactory; replacescout({ localOnly: true })withscout({})sincelocalOnlywas removed in remove scout local mode #65.test/agent-run.test.ts— drop a duplicatepresetskey in thecreateConfigfactory.test/init-orchestrator.test.ts— add the missingscoringblock in the init mock.test/machine-agent.test.ts— addrepositoryTargetingto itscreateConfigfactory.test/machine-commands.test.ts— addrepositoryTargetingto the fiveAppConfig/ snapshot mocks that were missing it.Verification
$ bunx biome ci --linter-enabled=false src test index.ts package.json tsconfig.json
Checked 134 files in 195ms. No fixes applied.
(0 errors)
Local typecheck against the precise lines reported in the CI log was used to drive the fixes. I do not have Bun installed locally so the actual
bunx tsc --noEmitpass will run on CI for this PR.Notes