-
Notifications
You must be signed in to change notification settings - Fork 0
feat(strix): map official scan modes from dual-flow events #1054
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,66 @@ | ||
| # Strix official scan-mode mapping for dual GitHub / Git Flow | ||
|
|
||
| 검토 기준일: **2026-08-16** | ||
|
|
||
| ## Incident | ||
|
|
||
| The organization-required Strix workflow always ran Quick. `scripts/ci/strix_quick_gate.sh` already forwarded `STRIX_SCAN_MODE` (default `quick`) as `strix -n -t . --scan-mode $SCAN_MODE`, but `.github/workflows/strix.yml` never set the environment variable. Every current event therefore inherited Quick: `pull_request_target`, `push` to `main`/`develop`/`master`, the Monday 03:00 UTC `schedule`, and `repository_dispatch` type `strix-scan`. | ||
|
|
||
| Official Strix CLI modes are only `quick`, `standard`, and `deep` (usestrix/strix `--scan-mode` choices). There is no `normal` alias. Quick is the CI/PR path (minutes). Standard is pre-release / weekly (30 min–1 h). Deep is pre-production (1–4 h). The CLI default is deep; CWL must keep choosing explicitly. | ||
|
|
||
| The previous 120 / 100 / 90 / 95-minute budget is honest for Quick and Standard. It cannot finish Deep. GitHub-hosted jobs max out at 360 minutes. | ||
|
|
||
| ## Decision | ||
|
|
||
| ContextualWisdomLab runs both GitHub Flow (`main`/`master` is the base) and Git Flow (`develop` is the base). That dual-flow setup is incomplete: there is no consistent RC-tag, prerelease, or GitHub `release` event convention, and RankWeave forbids prerelease GitHub Releases. This change therefore does **not** invent `release:` or `v*-rc*` triggers. | ||
|
|
||
| Confirmed event → official mode mapping: | ||
|
|
||
| | Event | Mode | Job / step / process / total | | ||
| |---|---|---| | ||
| | `pull_request_target` | `quick` | 120 / 100 / 5400 / 5700 | | ||
| | `repository_dispatch` `strix-scan` | `quick` | 120 / 100 / 5400 / 5700 | | ||
| | `push` to `develop` | `quick` | 120 / 100 / 5400 / 5700 | | ||
| | `push` to `main` or `master` | `standard` | 120 / 100 / 5400 / 5700 | | ||
| | `schedule` (Monday 03:00 UTC) | `standard` | 120 / 100 / 5400 / 5700 | | ||
| | `workflow_dispatch` `scan_mode` | chosen (`quick` / `standard` / `deep`, default `standard`) | Deep only: 360 / 340 / 14400 / 16200 | | ||
|
|
||
| `repository_dispatch` remains the default-branch-only, PR-metadata-bound same-head retry. It cannot scan a branch or tag release candidate. The mapping requires `github.event_name == 'push'` before treating `refs/heads/main` or `refs/heads/master` as Standard, because a `repository_dispatch` SHA is the default branch and is often `main`. | ||
|
|
||
| `workflow_dispatch` is restored with a single `scan_mode` choice so an incomplete release candidate can be scanned by hand. Deep is allowed only on that manual path. The required PR job stays on the 120-minute budget. Deep uses the GitHub-hosted 360-minute ceiling and leaves about 20 minutes after the 340-minute step for artifact and status publication. | ||
|
|
||
| ## Residual: workflow_dispatch revision selection | ||
|
|
||
| GitHub's manual-run UI and `gh workflow run --ref` let a repository writer choose which revision supplies the workflow definition *before* the trusted-source checkout (GitHub, n.d., *Manually running a workflow*). After this YAML is on the default branch, that selected revision runs with scanner secrets and `id-token: write`. A job-level `if:` on `main` does not stop a malicious selected revision. Write access is the only control. | ||
|
|
||
| This residual is accepted because CWL has no RC-tag convention and Deep must remain available by hand on this file. Do not add `target_repository` or `pr_number` inputs to "fix" it; those would widen the privileged surface. Privileged same-head retries stay on default-branch `repository_dispatch` type `strix-scan`. | ||
|
|
||
| `require_safe_scan_mode` now allowlists `quick|standard|deep` and rejects `normal` and every other string, including charset-valid aliases. | ||
|
|
||
| Fail-closed behavior is unchanged: missing artifact, unmapped findings, infrastructure errors, PR scoping, and severity gating stay as they were. The hashed-lock installer line is not part of this change. | ||
|
|
||
| `pull_request_target` continues to execute trusted base scripts only. | ||
|
|
||
| ## Verification contract | ||
|
|
||
| `tests/test_strix_scan_mode_policy.py` and `scripts/ci/test_strix_quick_gate.sh` fail if: | ||
|
|
||
| 1. the event → mode expression is reverted or `repository_dispatch` can select a mode; | ||
| 2. Deep job/step/process budgets apply to the required PR path; | ||
| 3. a GitHub release event or RC-tag trigger is added; | ||
| 4. `require_safe_scan_mode` accepts `normal` or any unofficial name; | ||
| 5. `workflow_dispatch` grows repository, pull-request, or privileged-retry inputs. | ||
|
|
||
| The quality workflow trigger includes this record, the mapping test, and `.github/workflows/strix.yml` so later edits re-run exact-head evidence. | ||
|
|
||
| ## Rollback | ||
|
|
||
| Roll back the mapping and this record together only if a required `pull_request_target` job is observed running Deep or a 360-minute budget. Do not restore unconditional Quick by deleting `STRIX_SCAN_MODE`. Do not invent RC tags to replace the manual `workflow_dispatch` path. | ||
|
|
||
| ## References (APA 7th) | ||
|
|
||
| GitHub. (n.d.). *Workflow syntax for GitHub Actions*. GitHub Docs. Retrieved August 16, 2026, from https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax | ||
|
|
||
| GitHub. (n.d.). *Manually running a workflow*. GitHub Docs. Retrieved August 16, 2026, from https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow | ||
|
|
||
| Strix. (n.d.). *Command-line interface* (`--scan-mode` `{quick,standard,deep}`). usestrix/strix. Retrieved August 16, 2026, from https://github.com/usestrix/strix |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restoring
workflow_dispatchon this privileged file re-opens GitHub's Branch dropdown /gh workflow run --refpath (GitHub, n.d., Manually running a workflow). After this YAML is on the default branch, the selected revision supplies the workflow definition before the trusted-source checkout, with scanner secrets andid-token: write.A job-level
if:onmaindoes not stop a malicious selected revision. Write access is the only control. Either record that residual indocs/doctoring/strix-scan-mode-dual-flow.md, or move Deep off thispull_request_targetfile. Do not addtarget_repository/pr_numberinputs to “fix” it.