Skip to content

feat(notifications): config-as-code overrides for the maintainer recap cadence#4421

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
oktofeesh1:feat-maintainer-recap-config-override-2250
Jul 9, 2026
Merged

feat(notifications): config-as-code overrides for the maintainer recap cadence#4421
JSONbored merged 2 commits into
JSONbored:mainfrom
oktofeesh1:feat-maintainer-recap-config-override-2250

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

  • Lets an operator set the cross-repo maintainer recap digest's enabled/cadence/channel knobs via .gittensory.yml config-as-code instead of only the GITTENSORY_MAINTAINER_RECAP / GITTENSORY_RECAP_CADENCE env vars (feat(notifications): config-as-code recap channel/cadence overrides in .gittensory.yml focus manifest #2250).
  • Adds a maintainerRecap: block to the focus-manifest schema (packages/gittensory-engine/src/focus-manifest.ts), mirroring the existing reviewRecap: block's shape (no DB-backed counterpart; the parsed value IS the effective value). Invalid cadence/channel values fall back to their defaults (weekly/discord) via the shared normalizeEnum helper, with a warning.
  • resolveMaintainerRecapManifestOverride (src/review/maintainer-recap-wire.ts) reads this block off the gittensory self-repo's manifest (resolveGittensorySelfRepoFullName) — a present block wins outright over the env vars for both isRecapEnabled and shouldFireMaintainerRecap; absent/errored, the env vars decide exactly as before. Wired into both the cron enqueue path (src/index.ts) and the queue processor's defense-in-depth check (src/queue/processors.ts).
  • Also fixed a related gap found along the way: src/selfhost/config-lint.ts's TOP_LEVEL_FIELDS allowlist didn't recognize maintainerRecap:, which would have produced a false "unknown top-level field" warning for a self-host operator using it (mirrors the existing repoDocGeneration/reviewRecap regression tests for the same class of bug).
  • Closes feat(notifications): config-as-code recap channel/cadence overrides in .gittensory.yml focus manifest #2250.

A deliberate design deviation from the issue's literal citation

#2250 pointed at resolveEffectiveSettings / src/settings/repository-settings.ts:34 (i.e., wiring this through RepositorySettings). I did not do that, on purpose: RepositorySettings/resolveEffectiveSettings resolve settings per contributor repo, but the maintainer recap digest is an operator-level, cross-repo concern (one digest spanning every scanned repo) — there is no single contributor repo whose settings should govern it. Threading it through RepositorySettings would have also required updating the RepositorySettingsSchema/OpenAPI surface (ui:openapi:settings-parity) and the settings API routes for a field that isn't actually a per-repo setting.

Instead, the override is resolved from the gittensory self-repo's own manifest (the repo this instance identifies as, via the existing resolveGittensorySelfRepoFullName helper already used for other self-referential/operator-level lookups) — the same "config-as-code for an operator-level setting" shape, without inventing a fake per-repo scope for a setting that isn't per-repo. This keeps RepositorySettingsSchema/OpenAPI and the settings API completely untouched (verified: npm run ui:openapi:settings-parity passes unchanged).

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused (a config-as-code override layered on top of the existing recap cron/job) and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves — Closes #2250.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally — 100% branch coverage on every changed line, verified directly against lcov.info (not just the aggregate report) for every touched file.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:openapi:settings-parity — unchanged (confirms RepositorySettings was deliberately left untouched, see above)
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • Full npm run test:ci green (630 test files / 12,539 tests), verified both before and after rebasing onto upstream main.
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — see below.

Test coverage added:

  • test/unit/focus-manifest.test.ts: a full maintainerRecap: describe block mirroring reviewRecap: — omitted/null key, non-mapping value, enabled parse + non-boolean warning, cadence parse + invalid-value fallback (both daily/weekly and an invalid string), channel parse + invalid-value fallback (e.g. slack, since only Discord delivery exists for this digest today), round-trip through maintainerRecapConfigToJson, and the doc-token coverage test (.gittensory.yml.example documents every field).
  • test/unit/maintainer-recap-wire.test.ts: isRecapEnabled/shouldFireMaintainerRecap — a present manifest override winning over the env value in both directions, and falling back to env when not present; resolveMaintainerRecapManifestOverride — returns the configured block, returns present: false when unconfigured, and degrades to present: false (never throws) when the manifest load itself fails.
  • test/unit/queue.test.ts / test/unit/index.test.ts: existing feat(notifications): schedule the recap job on the cron with a configurable cadence knob #2248 tests re-verified to still pass with the new override resolution wired into both the cron path and the processor's defense-in-depth check (a manifest-load fetch during these tests is now distinguished from the actual Discord webhook fetch).
  • test/unit/focus-manifest-validation.test.ts: the normalized-JSON output includes maintainerRecap when configured and omits it when absent.
  • test/unit/selfhost-config-lint.test.ts: a regression test for the TOP_LEVEL_FIELDS allowlist gap described above.
  • test/unit/config-templates.test.ts: kept green by mirroring the new .gittensory.yml.example documentation block into config/examples/gittensory.full.yml (a byte-identical-from-marker golden-file check).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no auth/CORS/session surface touched.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A by design — see the deviation note above; ui:openapi:settings-parity confirms no drift.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section. (N/A — no visible UI changes; backend + config-schema only.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (.gittensory.yml.example and config/examples/gittensory.full.yml updated in lockstep; no changelog edit.)

UI Evidence

N/A — backend + config-schema change only, no UI surface touched.

Notes

@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner July 9, 2026 12:36
@superagent-security

Copy link
Copy Markdown
Contributor

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

…p cadence

Lets an operator set the cross-repo maintainer recap digest's
enabled/cadence/channel knobs via the gittensory self-repo's
.gittensory.yml maintainerRecap: block instead of only the
GITTENSORY_MAINTAINER_RECAP/GITTENSORY_RECAP_CADENCE env vars. A
present manifest block wins over the env vars, which stay the
fallback when it is absent or invalid.
@JSONbored JSONbored added gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 9, 2026
The engine copy's trustMaintainerAuthoredIssueForReward comment had
drifted from its src/review/ twin after a recent merge, tripping the
check-engine-parity tripwire for any branch based on current main.
Comment-only resync, no logic change.
@oktofeesh1
oktofeesh1 force-pushed the feat-maintainer-recap-config-override-2250 branch from dbfc954 to e53472e Compare July 9, 2026 17:43
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@ba25589). Learn more about missing BASE report.
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4421   +/-   ##
=======================================
  Coverage        ?   93.97%           
=======================================
  Files           ?      411           
  Lines           ?    37202           
  Branches        ?    13587           
=======================================
  Hits            ?    34962           
  Misses          ?     1585           
  Partials        ?      655           
Files with missing lines Coverage Δ
packages/gittensory-engine/src/focus-manifest.ts 99.10% <100.00%> (ø)
...ngine/src/review/linked-issue-label-propagation.ts 100.00% <ø> (ø)
src/index.ts 95.18% <100.00%> (ø)
src/queue/processors.ts 95.38% <100.00%> (ø)
src/review/maintainer-recap-wire.ts 100.00% <100.00%> (ø)
src/selfhost/config-lint.ts 100.00% <ø> (ø)
src/services/focus-manifest-validation.ts 100.00% <100.00%> (ø)
src/signals/focus-manifest-loader.ts 99.18% <ø> (ø)
src/signals/focus-manifest.ts 99.63% <ø> (ø)
🚀 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 d38239a into JSONbored:main Jul 9, 2026
10 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 9, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Development

Successfully merging this pull request may close these issues.

feat(notifications): config-as-code recap channel/cadence overrides in .gittensory.yml focus manifest

2 participants