Skip to content

fix(review): preserve cached review instructions - #1586

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-missing-review.instructions-in-cache
Jun 27, 2026
Merged

fix(review): preserve cached review instructions#1586
JSONbored merged 1 commit into
mainfrom
codex/fix-missing-review.instructions-in-cache

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The repo-level review.instructions field was parsed into the in-memory focus manifest but not emitted when the manifest was serialized for cache persistence, causing maintainer instructions to be lost after a cache round-trip and making per-repo reviewer guidance unreliable.

Description

  • Emit review.instructions from reviewConfigToJson so manifestToJson persists it, and add a regression unit test in test/unit/focus-manifest-loader.test.ts that verifies a repo-file manifest with review.instructions survives the repo-file cache round trip.

Testing

  • Ran targeted unit tests with npm test -- --run test/unit/focus-manifest.test.ts test/unit/focus-manifest-loader.test.ts and all tests passed (158 tests); ran typecheck with npm run typecheck (tsc --noEmit) which passed; npm run test:coverage ran the tests but coverage remapping failed with TypeError: jsTokens is not a function; npm audit --audit-level=moderate could not complete due to a registry 403, so the full CI gate was not executed in this environment.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (00cff73) to head (b31a881).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1586   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files         202      202           
  Lines       21839    21840    +1     
  Branches     7885     7886    +1     
=======================================
+ Hits        20849    20850    +1     
  Misses        414      414           
  Partials      576      576           
Files with missing lines Coverage Δ
src/signals/focus-manifest.ts 99.15% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 6f8472f into main Jun 27, 2026
18 checks passed
@JSONbored
JSONbored deleted the codex/fix-missing-review.instructions-in-cache branch June 27, 2026 08:35
@loopover-orb

loopover-orb Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review — safe to merge

2 files · 1 AI reviewers · no blockers · readiness 48/100 · CI green · unknown

✅ Approved — safe to merge

Review summary
Exactly the right one-liner in exactly the right place. `reviewConfigToJson` was silently dropping `instructions` while every other nullable field on `FocusManifestReviewConfig` (`note`, `profile`, `inline_comments`) was already emitted — the fix follows the identical null-guard pattern with no deviation. The regression test is genuine: it drives `loadRepoFocusManifest` with a real fetcher, confirms the first call parses the field correctly, then verifies the second call hits cache (`fetches === 1`) and the value survives the round-trip intact. No fabricated state, no wrong-layer patch.

Signal Result Evidence
Code review ✅ No blockers 1 reviewers, synthesized
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Review load ❌ 8/20 Readiness component derived from cached public PR metadata and labels.
Validation evidence ❌ 5/25 Cached preflight status is hold.
Open PR queue ❌ 3/10 26 open PR(s), 9 likely reviewable, 17 unlinked.
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 80 PR(s), 312 issue(s).
Gate result ✅ Passing No configured blocker found.
Nits — 3 non-blocking
  • test/unit/focus-manifest-loader.test.ts: the string `"Follow our async-error conventions."` appears twice in the new `it` block — extract it to a `const INSTRUCTIONS` at the top so the two `toBe` assertions can't silently drift if the literal is later edited.
  • test/unit/focus-manifest-loader.test.ts: the new test covers only the populated-instructions path; a sibling case asserting `second.review.instructions` is `null` when the repo file omits the field would make the null arm explicit and mirror the `falls back to an empty manifest` convention already in this file (codecov/patch is green so the branch is covered by existing tests, but an explicit case documents intent).
  • src/signals/focus-manifest.ts: the failure class here — parse-path wired for a new field, emit-path silently omitted — is structurally invisible until a cache miss exposes it in production. A round-trip identity assertion in `focus-manifest.test.ts` of the shape `expect(reviewConfigToJson(reviewConfigFromJson(raw))).toEqual(raw)` covering all fields would make every future omission self-detecting without requiring a per-field regression test each time.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 80 PR(s), 312 issue(s).
  • Related work: Titles/paths share 4 meaningful terms. (PR #1583)
  • Related work: Titles/paths share 5 meaningful terms. (PR #1581, PR #1587)
  • Related work: Titles/paths share 5 meaningful terms. (PR #1582, PR #1583)
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Review top overlaps.
  • Add scope summary.
  • Fix blocker.
  • Expect slower review.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Review details

Generated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative.

Exactly the right one-liner in exactly the right place. `reviewConfigToJson` was silently dropping `instructions` while every other nullable field on `FocusManifestReviewConfig` (`note`, `profile`, `inline_comments`) was already emitted — the fix follows the identical null-guard pattern with no deviation. The regression test is genuine: it drives `loadRepoFocusManifest` with a real fetcher, confirms the first call parses the field correctly, then verifies the second call hits cache (`fetches === 1`) and the value survives the round-trip intact. No fabricated state, no wrong-layer patch.

Nits (3)

  • test/unit/focus-manifest-loader.test.ts: the string `"Follow our async-error conventions."` appears twice in the new `it` block — extract it to a `const INSTRUCTIONS` at the top so the two `toBe` assertions can't silently drift if the literal is later edited.
  • test/unit/focus-manifest-loader.test.ts: the new test covers only the populated-instructions path; a sibling case asserting `second.review.instructions` is `null` when the repo file omits the field would make the null arm explicit and mirror the `falls back to an empty manifest` convention already in this file (codecov/patch is green so the branch is covered by existing tests, but an explicit case documents intent).
  • src/signals/focus-manifest.ts: the failure class here — parse-path wired for a new field, emit-path silently omitted — is structurally invisible until a cache miss exposes it in production. A round-trip identity assertion in `focus-manifest.test.ts` of the shape `expect(reviewConfigToJson(reviewConfigFromJson(raw))).toEqual(raw)` covering all fields would make every future omission self-detecting without requiring a per-field regression test each time.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant