Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/hourly-nvidia-nim-review-repair.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ on:
- .github/workflows/clearfolio-hourly-review-repair.yml
- .github/workflows/disksage-hourly-review-repair.yml
- .github/workflows/fast-mlsirm-hourly-review-repair.yml
- .github/workflows/inkspan-hourly-review-repair.yml
- .github/workflows/naruon-hourly-review-repair.yml
- .github/workflows/hourly-nvidia-nim-review-repair.yml
- scripts/ci/pr_review_conflict_scope.py
- scripts/ci/pr_review_autofix_context.py
- tests/test_disksage_hourly_review_caller.py
- tests/test_fast_mlsirm_hourly_review_caller.py
- tests/test_inkspan_hourly_review_caller.py
- tests/test_naruon_hourly_review_caller.py
- tests/test_hourly_scheduler_runtime_budget.py
- tests/test_hourly_autofix_context_quality_gate.py
- tests/test_pr_review_conflict_scope.py
Expand All @@ -32,6 +36,8 @@ on:
- docs/doctoring/conflict-control-evidence-isolation.md
- docs/doctoring/disksage-hourly-review-caller.md
- docs/doctoring/fast-mlsirm-hourly-review-caller.md
- docs/doctoring/inkspan-hourly-review-caller.md
- docs/doctoring/naruon-hourly-review-caller.md
- docs/doctoring/hourly-nvidia-nim-autofix.md
push:
paths:
Expand All @@ -41,11 +47,15 @@ on:
- .github/workflows/clearfolio-hourly-review-repair.yml
- .github/workflows/disksage-hourly-review-repair.yml
- .github/workflows/fast-mlsirm-hourly-review-repair.yml
- .github/workflows/inkspan-hourly-review-repair.yml
- .github/workflows/naruon-hourly-review-repair.yml
- .github/workflows/hourly-nvidia-nim-review-repair.yml
- scripts/ci/pr_review_conflict_scope.py
- scripts/ci/pr_review_autofix_context.py
- tests/test_disksage_hourly_review_caller.py
- tests/test_fast_mlsirm_hourly_review_caller.py
- tests/test_inkspan_hourly_review_caller.py
- tests/test_naruon_hourly_review_caller.py
- tests/test_hourly_scheduler_runtime_budget.py
- tests/test_hourly_autofix_context_quality_gate.py
- tests/test_pr_review_conflict_scope.py
Expand All @@ -64,6 +74,8 @@ on:
- docs/doctoring/conflict-control-evidence-isolation.md
- docs/doctoring/disksage-hourly-review-caller.md
- docs/doctoring/fast-mlsirm-hourly-review-caller.md
- docs/doctoring/inkspan-hourly-review-caller.md
- docs/doctoring/naruon-hourly-review-caller.md
- docs/doctoring/hourly-nvidia-nim-autofix.md

permissions:
Expand Down Expand Up @@ -114,6 +126,8 @@ jobs:
tests/test_pr_review_conflict_scope.py \
tests/test_disksage_hourly_review_caller.py \
tests/test_fast_mlsirm_hourly_review_caller.py \
tests/test_inkspan_hourly_review_caller.py \
tests/test_naruon_hourly_review_caller.py \
tests/test_hourly_scheduler_runtime_budget.py \
tests/test_pr_review_conflict_scope_control_files.py \
tests/test_hourly_autofix_context_quality_gate.py \
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/inkspan-hourly-review-repair.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Inkspan Hourly Review Repair

on:
schedule:
# Minute 47 avoids the Clearfolio and DiskSage heartbeats.
- cron: "47 * * * *"

concurrency:
group: inkspan-hourly-review-repair
# A later heartbeat must not cancel an in-flight queue decision or repair.
cancel-in-progress: false

permissions:
contents: read

jobs:
dispatch-review-repair:
uses: ./.github/workflows/pr-review-fix-scheduler.yml
with:
target_repository: ContextualWisdomLab/inkspan
base_branch: main
max_prs: "50"
max_dispatches: "1"
retry_hours: "1"
secrets:
PR_REVIEW_MERGE_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN }}
OPENCODE_APPROVE_TOKEN: ${{ secrets.OPENCODE_APPROVE_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/naruon-hourly-review-repair.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: naruon Hourly Review Repair

on:
schedule:
# Minute 11 avoids Clearfolio (23), DiskSage (37), and Inkspan (47).
- cron: "11 * * * *"

concurrency:
group: naruon-hourly-review-repair
# A later heartbeat must not cancel an in-flight queue decision or repair.
cancel-in-progress: false

permissions:
contents: read

jobs:
dispatch-review-repair:
uses: ./.github/workflows/pr-review-fix-scheduler.yml
with:
target_repository: ContextualWisdomLab/naruon
base_branch: develop
max_prs: "50"
max_dispatches: "1"
retry_hours: "1"
secrets:
PR_REVIEW_MERGE_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN }}
OPENCODE_APPROVE_TOKEN: ${{ secrets.OPENCODE_APPROVE_TOKEN }}
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<!-- CWL-ENTRY -->
> **Agents: read the master context FIRST.** Before any work, read [`docs/CWL-MASTER-CONTEXT.md`](docs/CWL-MASTER-CONTEXT.md) (mission · naruon-as-platform + inter-component UML · cross-cutting disciplines · conventions · roadmap · current state), the live **GitHub Project #1** <https://github.com/orgs/ContextualWisdomLab/projects/1> (work/roadmap source of truth), the full spec **ContextualWisdomLab/naruon#974**, and operate the Project per [`docs/agent-github-project-protocol.md`](docs/agent-github-project-protocol.md). The repo/Project — not any private agent memory — is the source of truth.

Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include (no `.`/`..`); a lone `--require-hashes` directive is not trust evidence. See [`docs/doctoring/hourly-nvidia-nim-autofix.md`](docs/doctoring/hourly-nvidia-nim-autofix.md).
Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include (no `.`/`..`); a lone `--require-hashes` directive is not trust evidence. See [`docs/doctoring/hourly-nvidia-nim-autofix.md`](docs/doctoring/hourly-nvidia-nim-autofix.md) and [`docs/doctoring/trusted-uv-lock-materialization.md`](docs/doctoring/trusted-uv-lock-materialization.md).
Conflict-scope roots fail closed when the immediate parent directory is a symbolic link.
The Inkspan hourly repair caller runs at minute 47; the naruon caller runs at minute 11 against protected `develop`. See [`docs/doctoring/inkspan-hourly-review-caller.md`](docs/doctoring/inkspan-hourly-review-caller.md) and [`docs/doctoring/naruon-hourly-review-caller.md`](docs/doctoring/naruon-hourly-review-caller.md).
13 changes: 9 additions & 4 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ The worker checks out helpers at `${{ github.sha }}` so a later default-branch
push cannot replace privileged scripts after dispatch (CWE-367). Repair binds
`NVIDIA_NIM_API_KEY`, never `COPILOT_GITHUB_TOKEN`.

Product callers stagger Clearfolio at minute 23, DiskSage at minute 37, and
fast-mlsirm at minute 49. Each caller is read-only, dispatches at most one
repair, and delegates all privileged logic to the same sealed scheduler.
Product callers stagger naruon at minute 11, Clearfolio at minute 23, DiskSage
at minute 37, Inkspan at minute 47, and fast-mlsirm at minute 49. Each caller
is read-only, dispatches at most one repair, and delegates all privileged
logic to the same sealed scheduler.

## Control-plane data flow

Expand Down Expand Up @@ -107,4 +108,8 @@ tests pin workflow structure and governance prose so drift fails closed.
- [`docs/doctoring/hourly-nvidia-nim-autofix.md`](docs/doctoring/hourly-nvidia-nim-autofix.md)
— current increment's repair-worker decision and APA 7th citations.
- [`docs/doctoring/fast-mlsirm-hourly-review-caller.md`](docs/doctoring/fast-mlsirm-hourly-review-caller.md)
— product-specific psychometric repair heartbeat and scientific gates.
— product-specific psychometric repair heartbeat and scientific gates.
- [`docs/doctoring/inkspan-hourly-review-caller.md`](docs/doctoring/inkspan-hourly-review-caller.md)
— Inkspan editor hourly caller, allowlist, and CWE-269 boundary.
- [`docs/doctoring/naruon-hourly-review-caller.md`](docs/doctoring/naruon-hourly-review-caller.md)
— naruon platform hourly caller and fail-closed activation.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ Semantic Versioning where the repository publishes a release.
- Added a dedicated Clearfolio hourly caller that invokes the product-neutral central scheduler with the exact repository, protected base branch, one-dispatch budget, one-hour retry floor, single-flight concurrency, and only the established scheduler credentials.
- Added a dedicated DiskSage hourly caller that invokes the same product-neutral RCA and remediation-feasibility scheduler with an exact repository target, one-dispatch budget, two-hour same-head retry floor, non-cancelling single-flight heartbeat, and explicit established scheduler credentials.
- Added a dedicated fast-mlsirm hourly caller that preserves Rust-owned psychometric arithmetic while dispatching at most one exact-head, root-cause-driven repair with a two-hour same-head retry floor.
- Added a dedicated Inkspan hourly caller that invokes the product-neutral RCA scheduler for `ContextualWisdomLab/inkspan` at minute 47 with a one-dispatch budget, one-hour same-head retry floor, non-cancelling single-flight heartbeat, and only the established scheduler credentials.
- Added a dedicated naruon hourly caller that invokes the same reusable scheduler for `ContextualWisdomLab/naruon` at minute 11 against protected `develop` so live platform PRs receive bounded NVIDIA NIM review repair without sharing a runner burst with sibling callers.

### Changed

- Require the hourly repair worker to establish an exact-head root cause, enumerate the smallest remediation candidates, and prove writer authority, sealed-path scope, credentials, dependency order, verifiability, and causal effect before editing; infeasible or external blockers leave the tree unchanged while the broader loop continues with another eligible PR or buyer-visible product gap.
- Run the bounded Clearfolio PR review-feedback repair caller at minute 23 of every hour while keeping the shared scheduler free of product-specific timers and repository names for modular reuse by naruon, contextual-orchestrator, Inkspan, and other CWL services.
- Run the bounded DiskSage repair heartbeat at minute 37 of every hour, dispatch no more than one exact-head repair, and wait two hours before redispatching an unchanged head so legitimate OpenCode or NVIDIA NIM latency does not create duplicate writers.
- Run the bounded fast-mlsirm repair heartbeat at minute 49 of every hour with one-dispatch scope and a two-hour same-head floor, without weakening true-parameter recovery, CPU/GPU parity, skipped-test, or Rust-ownership gates.
- Run the bounded naruon repair heartbeat at minute 11 and the bounded Inkspan repair heartbeat at minute 47, each dispatching at most one exact-head repair and waiting one hour before redispatching an unchanged head.
- Use NVIDIA NIM `mistralai/mistral-small-4-119b-2603` with explicit high reasoning for scheduled repair and `nvidia/nemotron-3-nano-30b-a3b` for bounded helper work instead of GitHub Models in the write-capable autofix worker.
- Apply one NUL-delimited exact-path and complete pre/post-worktree verification contract to both ordinary review repair and merge-conflict repair rather than relying on a visible post-model diff for the ordinary path.

### Fixed

- Point the naruon hourly review-repair caller at protected `develop` so buyer-facing platform PRs are scanned; `main` is not naruon's integration branch.
- Materialized base Python locks only when every package line is an exact SHA-256 pin or a bounded relative `-r`/`--requirement` include. A lone `--require-hashes` directive, a dotted include such as `./lock.txt`, or `-r other-hashes.txt` no longer enters the trusted build context.
- Refused a conflict-scope repository root whose immediate parent is a symbolic link, so a swapped parent cannot redirect the canonical worktree after the last-component check (CWE-367).
- Bounded the Strix quality self-test's deterministic timeout fixtures to 3-second process and 5-second fake-sleep budgets so exact-head policy evidence completes inside the existing job limit without changing production Strix scanner timeouts, providers, credentials, or review semantics.
Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ Details: `README.md` and `PR_GOVERNANCE_AUDIT.md`.
- `docs/` — master context, Project protocol, `org-required-workflow-rollout.md`,
`scorecard-governance.md`, SBOM inventory. Doctoring records live under
`docs/doctoring/`. [`ARCHITECTURE.md`](ARCHITECTURE.md) is the control-plane
diagram for review, hourly NVIDIA NIM repair, and merge trust boundaries.
diagram for review, hourly NVIDIA NIM repair (including Inkspan minute 47
and naruon minute 11 callers), and merge trust boundaries.
- `.jules/` — recorded performance (`bolt.md`) and security (`sentinel.md`) learnings from past work
on `scripts/ci/`; worth scanning before optimizing or hardening those scripts.

Expand Down
45 changes: 45 additions & 0 deletions docs/automation/hourly-review-repair.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ engine**.

- `clearfolio-hourly-review-repair.yml` owns Clearfolio's heartbeat at minute 23
of every hour.
- `naruon-hourly-review-repair.yml` owns naruon's heartbeat at minute 11
with a one-hour same-head retry floor.
- `inkspan-hourly-review-repair.yml` owns Inkspan's heartbeat at minute 47
with a one-hour same-head retry floor.
- `pr-review-fix-scheduler.yml` is the reusable, product-neutral scheduler
module. It has no product-specific timer and can be called by naruon,
contextual-orchestrator, Inkspan, or another CWL service with an explicit
Expand Down Expand Up @@ -39,6 +43,43 @@ The caller passes only the established `PR_REVIEW_MERGE_TOKEN` and
`NVIDIA_NIM_API_KEY`; the model credential is scoped exclusively to the two
OpenCode execution steps in the separately reviewed autofix worker.

## naruon execution contract

The naruon caller is a thin consumer of the same reusable scheduler:

```yaml
target_repository: ContextualWisdomLab/naruon
base_branch: develop
max_prs: "50"
max_dispatches: "1"
retry_hours: "1"
```

It runs at `11 * * * *`, uses its own non-cancelling single-flight group, and
passes only the two established scheduler credentials. naruon change
requests land on protected `develop`; the caller must not scan `main`.
Before activation of this control-plane caller, `OPENCODE_REPOSITORY_DISPATCH_TARGETS` must include the exact
naruon repository. A missing target mapping fails before any mutation
credential is materialized; it never falls back to a broader repository scope.

## Inkspan execution contract

The Inkspan caller is another thin consumer of the same reusable scheduler:

```yaml
target_repository: ContextualWisdomLab/inkspan
base_branch: main
max_prs: "50"
max_dispatches: "1"
retry_hours: "1"
```

It runs at `47 * * * *`, uses its own non-cancelling single-flight group, and
passes only the two established scheduler credentials. Before activation on
protected `main`, `OPENCODE_REPOSITORY_DISPATCH_TARGETS` must include the exact
Inkspan repository. A missing target mapping fails before any mutation
credential is materialized; it never falls back to a broader repository scope.

## Reusable target-selection contract

The shared scheduler resolves its target in this order:
Expand Down Expand Up @@ -195,6 +236,10 @@ Permanent tests prove:

- the Clearfolio caller owns exactly one hourly schedule and names the exact
repository and protected base branch;
- the naruon caller owns its distinct minute-11 schedule, exact repository,
protected base, non-cancelling concurrency, and explicit secret contract;
- the Inkspan caller owns its distinct minute-47 schedule, exact repository,
protected base, non-cancelling concurrency, and explicit secret contract;
- the shared scheduler contains no product-specific timer or repository name;
- the dispatch budget and same-head retry floor remain one;
- caller and reusable-workflow secrets are explicit and never use
Expand Down
79 changes: 79 additions & 0 deletions docs/doctoring/inkspan-hourly-review-caller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Inkspan hourly review-repair caller

Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include; a lone `--require-hashes` line is not lock evidence.

## Decision and operating boundary

The central repository owns a thin scheduled caller for
`ContextualWisdomLab/inkspan`. It runs at minute 47 each hour and calls the
product-neutral `pr-review-fix-scheduler.yml` with protected base `main`, a
one-dispatch budget, and a one-hour same-head retry floor. Clearfolio runs at
minute 23 and DiskSage at minute 37, so the three callers do not create the same
avoidable runner burst.

The caller contains product identity, cadence, and explicit reusable-workflow
inputs only. Queue classification, exact-head binding, root-cause analysis,
remediation feasibility, retry markers, and repair dispatch remain central.
Inkspan continues to own its application, data, runtime, and release semantics.

## Authority and secret contract

The caller keeps `GITHUB_TOKEN` at `contents: read` and maps only
`PR_REVIEW_MERGE_TOKEN` and `OPENCODE_APPROVE_TOKEN`. It never uses
`secrets: inherit`, receives `NVIDIA_NIM_API_KEY`, or introduces
`COPILOT_GITHUB_TOKEN`. CWE-269 forbids granting the caller the worker's
write or model privileges (MITRE, 2026). Model credentials remain scoped
to the separately reviewed repair worker. The worker cannot approve,
merge, release, change protection, or manufacture passing evidence.

Before protected-main activation, the repository variable
`OPENCODE_REPOSITORY_DISPATCH_TARGETS` must contain the exact
`ContextualWisdomLab/inkspan` target. Missing or mismatched configuration fails
before mutation credential materialization. GitHub App installation and both
mapped credentials must also remain limited to approved repositories.

## Failure and recovery

A missing target allowlist entry, credential, or exact-head evidence is a
non-passing configuration state. Operators correct the bounded configuration
and rerun the unchanged protected source; they do not widen a token, inherit all
secrets, bypass protection, or perturb a clean PR head merely to trigger review.
A newer heartbeat does not cancel an in-flight decision. Same-head retry
markers and the per-PR writer lease prevent duplicate repair writers.

After source integration, closure requires a scheduled or manual protected-main
consumer run that proves the exact Inkspan target, read-only caller token,
bounded dispatch decision, and fail-closed credential behavior. Source checks
alone are not protected-main operational acceptance. Merge also retains every
required security check, zero unresolved valid findings, and a qualifying
independent non-author approval.

## Verification and rollback

Machine-checkable contracts require the exact target, minute 47 cadence,
non-cancelling single-flight group, one dispatch, one-hour retry floor, explicit
secret mapping, read-only permissions, central path-filter coverage, and
absence of model or Copilot credentials. The full owned suite and hosted
security/review gates must pass on the unchanged exact head.

Rollback removes the Inkspan caller, its focused test, doctoring, and the
associated central path-filter/documentation entries. It must not remove the
reusable scheduler's dispatch validation or affect the independent Clearfolio
and DiskSage callers.

## APA 7th references

MITRE. (2026). *CWE-269: Improper privilege management*.
https://cwe.mitre.org/data/definitions/269.html

GitHub, Inc. (n.d.-a). *Events that trigger workflows*. GitHub Docs. Retrieved
August 12, 2026, from
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule

GitHub, Inc. (n.d.-b). *Reuse workflows*. GitHub Docs. Retrieved August 12,
2026, from
https://docs.github.com/en/actions/how-tos/sharing-automations/reuse-workflows

GitHub, Inc. (n.d.-c). *Workflow syntax for GitHub Actions: Permissions*.
GitHub Docs. Retrieved August 12, 2026, from
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions
Loading
Loading