github prompt generator: normalizeGitHubTaskConfig accepts unknown properties, masking config typos
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start in src/prompt-generators/github/config.ts and compare its normalization with src/prompt-generators/bugzilla/config.ts and src/prompt-generators/gitlab/config.ts. Review src/test/schema.test.ts and the schema declarations, then verify that unknown task and search properties and invalid optional search values are rejected consistently with the documented fields.
Written by the indexing model from the issue text.
Description
Observed behavior
normalizeGitHubTaskConfig in src/prompt-generators/github/config.ts only validates that promptTemplate and search.repository and search.query are strings. It never calls assertKnownProperties, so any extra (typo'd or stale) property on the task config or on search is silently accepted.
This is inconsistent with the sibling generators:
src/prompt-generators/bugzilla/config.tscallsassertKnownPropertiesonbugzilla.search.src/prompt-generators/gitlab/config.tscallsassertKnownPropertiesongitlab.search.- The JSON schema in
schema/loop-the-loop.schema.jsondeclaresadditionalProperties: falsefor bothgithubTaskandgithubSearchParams.
Additionally, the github (constructor options) field on the task is not validated at all - a malformed object passed there reaches the SDK constructor.
Expected behavior
normalizeGitHubTaskConfig should reject unknown task-level properties and unknown search properties, matching the schema and the sibling generators. Recommended additions:
assertKnownProperties(value, ['github', 'search', 'promptTemplate'], 'github')assertKnownProperties(search, [...], 'github.search')covering every field inGitHubIssueSearchParams(repository,query,sort,order,perPage,maxResults,dryRun,logQuery).- Type checks for
sort,order,perPage,maxResults,dryRun,logQuery(currently any value is accepted).
Minimal reproduction
import { normalizeGitHubTaskConfig } from 'loop-the-loop/prompt-generators/github/config';
// Silently accepted today (with both 'repositry' typo and 'maxResultz' typo):
normalizeGitHubTaskConfig({
search: {
repository: 'octocat/Hello-World',
query: 'is:open',
maxResultz: 25, // typo - silently dropped at runtime
},
promptTemplate: 'Review {{id}}',
notAField: true, // typo at task level - also silently accepted
});
The same configs are correctly rejected when loaded through the AJV-validated schema (see src/__test__/schema.test.ts), so callers using the CLI loader will see the error, but programmatic callers and anyone bypassing the schema will not.
Suggested fix
Bring github/config.ts into line with bugzilla/config.ts and gitlab/config.ts: add assertKnownProperties for the task and the search params, and add per-field type assertions for the optional search params.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from joewalker/loop-the-loop
-
bug S4
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal information Openbug S3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
Difficulty 1/5 Under an hour Newbie friendliness 90/100
joewalker/loop-the-loop#79 ·
All issues in joewalker/loop-the-loop
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100