Skip to content

Build a SelfReviewContext fetcher for the miner's self-review pass #5145

Description

@JSONbored

Problem: IterateLoopInput.reviewContext (packages/gittensory-engine/src/miner/iterate-loop.ts) is a required SelfReviewContext (packages/gittensory-engine/src/miner/self-review-adapter.ts):

export type SelfReviewContext = {
  manifest: FocusManifest;
  repo: RepositoryRecord | null;
  issues: IssueRecord[];
  pullRequests: PullRequestRecord[];
  bounties?: BountyRecord[] | undefined;
  issueQuality?: IssueQualityReport | null | undefined;
  confirmedContributor?: boolean | undefined;
  inDuplicateCluster?: boolean | undefined;
};

Nothing in packages/gittensory-miner builds one from a real repo today. runMinerAttempt (lib/attempt-runner.js, #5133) requires input.loopInput.reviewContext to already be populated by its caller — so #5132's CLI dispatch cannot construct a valid AttemptInput for a real target without this.

Proposal: A fetcher in packages/gittensory-miner that, given repoFullName + issueNumber, builds a real SelfReviewContext at the same fidelity the live gate itself uses — not a placeholder/empty-default object (a self-review pass over fake context would look real while checking nothing, which is worse than not running self-review at all).

Concretely:

  • manifest: fetch the repo's manifest source and run it through parseFocusManifest/parseFocusManifestContent (@jsonbored/gittensory-engine). Reuse whatever GitHub-fetch pattern already exists in packages/gittensory-miner/lib/opportunity-fanout.js for the HTTP leg (its githubGetJson/githubHeaders helpers are currently module-private — export them, or add equivalent parallel helpers).
  • repo/issues/pullRequests/bounties/issueQuality/confirmedContributor/inDuplicateCluster: populate from real GitHub API data for the target repo/issue, matching the RepositoryRecord/IssueRecord/PullRequestRecord/BountyRecord/IssueQualityReport shapes the live gate already produces (check packages/gittensory-engine/src for the live gate's own construction of these records and mirror its data sourcing rather than inventing a new shape).

Deliverables: A tested function (e.g. fetchSelfReviewContext(repoFullName, issueNumber, deps)) in packages/gittensory-miner/lib/, returning a real SelfReviewContext, with unit tests covering each field's construction and the empty/missing-data edge cases (no bounties, no linked PRs, etc.).

Acceptance criteria: #5132's attempt CLI command can call this fetcher and pass its real output as loopInput.reviewContext to runMinerAttempt with no stubbed/empty fields silently substituted.

Boundaries: Scope is the fetcher only — not the CLI dispatch plumbing (#5132) or the coding-agent driver (#5131, done) or slop assessment (#5133, done).

Metadata

Metadata

Assignees

Labels

gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions