-
Notifications
You must be signed in to change notification settings - Fork 0
feat(inkspan): add protected hourly review-repair caller at minute 56 #1341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1dc5c90
feat(inkspan): add protected hourly review-repair caller at minute 56
seonghobae 622d810
Merge branch 'main' into feat/inkspan-hourly-review-caller
seonghobae 5441868
Merge branch 'main' into feat/inkspan-hourly-review-caller
seonghobae 813401f
fix(inkspan): wire caller into focused quality gate
seonghobae 8c916dc
fix(inkspan): reconcile hourly cadence ledger
seonghobae 7d4440c
docs(inkspan): correct heartbeat-minute ledger per Devin review
seonghobae 3659ae1
Merge branch 'main' into feat/inkspan-hourly-review-caller
seonghobae d816194
Merge branch 'main' into feat/inkspan-hourly-review-caller
opencode-agent[bot] 9455622
Merge branch 'main' into feat/inkspan-hourly-review-caller
opencode-agent[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Inkspan Hourly Review Repair | ||
|
|
||
| on: | ||
| schedule: | ||
| # Minute 56 avoids every existing hourly heartbeat minute and the | ||
| # half-hourly merge scheduler ticks. | ||
| - cron: "56 * * * *" | ||
|
seonghobae marked this conversation as resolved.
seonghobae marked this conversation as resolved.
|
||
|
|
||
| concurrency: | ||
| group: inkspan-hourly-review-repair | ||
| # The queue scan is bounded and the worker has its own exact-head lease. Do not | ||
| # discard an in-flight RCA merely because the next hourly heartbeat arrives. | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
seonghobae marked this conversation as resolved.
|
||
|
|
||
| jobs: | ||
| dispatch-review-repair: | ||
| uses: ./.github/workflows/pr-review-fix-scheduler.yml | ||
|
seonghobae marked this conversation as resolved.
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| with: | ||
| target_repository: ContextualWisdomLab/inkspan | ||
| base_branch: main | ||
| max_prs: "50" | ||
| max_dispatches: "1" | ||
| # Central OpenCode/NVIDIA NIM work can legitimately approach two hours. | ||
| # A two-hour same-head floor avoids duplicate writers without freezing the | ||
| # next eligible PR or confusing provider latency with a source-code defect. | ||
| retry_hours: "2" | ||
|
seonghobae marked this conversation as resolved.
|
||
| secrets: | ||
| PR_REVIEW_MERGE_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN }} | ||
| OPENCODE_APPROVE_TOKEN: ${{ secrets.OPENCODE_APPROVE_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
seonghobae marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Inkspan hourly review-repair caller | ||
|
|
||
| 검토 기준일: **2026-08-25** | ||
|
|
||
| ## Decision | ||
|
|
||
| ContextualWisdomLab operates one protected hourly caller for | ||
| `ContextualWisdomLab/inkspan` (deterministic Markdown/HTML authoring and | ||
| bounded document/evidence contracts). The caller runs at minute 56, delegates | ||
| to the product-neutral central review-fix scheduler, inspects at most 50 open | ||
| pull requests targeting protected `main`, and dispatches at most one bounded | ||
| repair per heartbeat. | ||
|
|
||
| A paying buyer of commercial-grade editor tooling would feel live Inkspan pull | ||
| requests stalling while the hourly NVIDIA NIM repair loop scanned only other | ||
| products in the organization. Live heads such as ContextualWisdomLab/inkspan#299 | ||
| (stacked-PR CI gates), ContextualWisdomLab/inkspan#362 (editor contrast and keyboard focus), and the | ||
| writing-diagnostics stack sit in exactly that blind spot when their checks are | ||
| green but central review evidence is missing or stale. | ||
|
|
||
| The caller does not implement review or mutation logic itself. Inkspan remains | ||
| standalone and embeddable; hosts consume `@contextualwisdomlab/cwl-editor` | ||
| without owning privileged automation. All mutation authority stays sealed in | ||
| `ContextualWisdomLab/.github` behind `PR_REVIEW_MERGE_TOKEN` / | ||
| `OPENCODE_APPROVE_TOKEN`. | ||
|
|
||
| ## Root-cause analysis and remediation feasibility | ||
|
|
||
| The reusable worker performs exact-head root-cause analysis, tests remediation | ||
| feasibility, and edits only when one small reversible action can change the | ||
| diagnosed cause inside its sealed writer authority. It follows the shared | ||
| transitions documented in the central scheduler contract: refetch live state, | ||
| establish the causal chain, enumerate materially distinct minimal remedies, | ||
| reject infeasible ones, and dispatch at most one repair per heartbeat. | ||
|
|
||
| Minute 56 (this caller) shares no heartbeat minute with any other hourly | ||
| caller: the occupied minutes are 2, 10, 14, 16, 21, 23, 27, 34, 37, 43, 49, | ||
| 53, and 58, so runner capacity is not contested at dispatch time. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Inkspan gains parity with disksage, nonnest2, Clearfolio, afipc, and | ||
| fast-mlsirm for bounded hourly unattended review-repair throughput. | ||
| - The two-hour same-head retry floor prevents duplicate writers while keeping | ||
| unrelated PR lanes moving every hour. | ||
| - No COPILOT_GITHUB_TOKEN is used; existing review-agent key chains are | ||
| untouched. | ||
| - The reusable job receives `id-token: write` and `contents: read`, enabling | ||
| its documented OIDC fallback while preserving least privilege. | ||
|
|
||
| The protected merge path still requires an independent non-author approval at | ||
| the exact head. The workflow forwards the existing `PR_REVIEW_MERGE_TOKEN` and | ||
| `OPENCODE_APPROVE_TOKEN`; the NVIDIA model credential is supplied by the | ||
| central worker as `NVIDIA_NIM_API_KEY` and is never embedded in this caller. | ||
|
|
||
| ## APA 7th references | ||
|
|
||
| GitHub. (n.d.). *OpenID Connect in GitHub Actions*. Retrieved August 25, 2026, | ||
| from https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| """Contract tests for Inkspan's bounded hourly review-repair caller.""" | ||
|
|
||
| from pathlib import Path | ||
|
|
||
|
|
||
| CALLER = Path(".github/workflows/inkspan-hourly-review-repair.yml") | ||
| DOCTORING = Path("docs/doctoring/inkspan-hourly-review-caller.md") | ||
| QUALITY_WORKFLOW = Path(".github/workflows/hourly-nvidia-nim-review-repair.yml") | ||
|
|
||
|
|
||
| def _read(path: Path) -> str: | ||
| """Return one repository contract file as UTF-8 text.""" | ||
| return path.read_text(encoding="utf-8") | ||
|
|
||
|
|
||
| def test_inkspan_caller_is_hourly_bounded_and_non_cancelling() -> None: | ||
| """Inkspan receives one bounded repair opportunity without overlap cancellation.""" | ||
| caller = _read(CALLER) | ||
|
|
||
| assert 'cron: "56 * * * *"' in caller | ||
| assert "group: inkspan-hourly-review-repair" in caller | ||
| assert "cancel-in-progress: false" in caller | ||
| assert "uses: ./.github/workflows/pr-review-fix-scheduler.yml" in caller | ||
| assert "target_repository: ContextualWisdomLab/inkspan" in caller | ||
| assert "base_branch: main" in caller | ||
| assert 'max_prs: "50"' in caller | ||
| assert 'max_dispatches: "1"' in caller | ||
| assert 'retry_hours: "2"' in caller | ||
|
|
||
|
|
||
| def test_inkspan_caller_preserves_credentials_and_oidc_scope() -> None: | ||
| """The caller grants only reusable-worker read/OIDC permissions.""" | ||
| caller = _read(CALLER) | ||
| workflow_scope, jobs_scope = caller.split("\njobs:\n", maxsplit=1) | ||
|
|
||
| assert "\npermissions:\n contents: read\n" in workflow_scope | ||
| assert "\n permissions:\n contents: read\n id-token: write\n" in jobs_scope | ||
| assert "PR_REVIEW_MERGE_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN }}" in caller | ||
| assert "OPENCODE_APPROVE_TOKEN: ${{ secrets.OPENCODE_APPROVE_TOKEN }}" in caller | ||
| assert "secrets: inherit" not in caller | ||
| assert "NVIDIA_NIM_API_KEY" not in caller | ||
| assert "COPILOT_GITHUB_TOKEN" not in caller | ||
| for forbidden in ( | ||
| "actions: write", | ||
| "contents: write", | ||
| "issues: write", | ||
| "pull-requests: write", | ||
| "statuses: write", | ||
| ): | ||
| assert forbidden not in caller | ||
|
|
||
|
|
||
| def test_inkspan_doctoring_records_governance_and_research_bounds() -> None: | ||
| """Operators retain RCA, credential, approval, and citation contracts.""" | ||
| doctoring = _read(DOCTORING) | ||
|
|
||
| for phrase in ( | ||
| "root-cause analysis", | ||
| "remediation feasibility", | ||
| "two-hour same-head retry floor", | ||
| "independent non-author approval", | ||
| "NVIDIA_NIM_API_KEY", | ||
| "COPILOT_GITHUB_TOKEN", | ||
| "ContextualWisdomLab/inkspan#299", | ||
| "ContextualWisdomLab/inkspan#362", | ||
| "APA 7th references", | ||
| ): | ||
| assert phrase in doctoring | ||
|
|
||
|
|
||
| def test_focused_quality_workflow_tracks_inkspan_caller_contracts() -> None: | ||
| """Caller and doctoring edits rerun exact-head scheduler verification.""" | ||
| quality = _read(QUALITY_WORKFLOW) | ||
|
|
||
| assert quality.count(".github/workflows/inkspan-hourly-review-repair.yml") == 2 | ||
| assert quality.count("docs/doctoring/inkspan-hourly-review-caller.md") == 2 | ||
| assert quality.count("tests/test_inkspan_hourly_review_caller.py") == 3 | ||
|
seonghobae marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.