|
| 1 | +name: Apply precision protocol loop |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - loop/precision-bug-hunting-protocol |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + apply: |
| 13 | + if: "github.event.head_commit.message == 'loop: setup - precision-first bug hunting'" |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v7 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - uses: pnpm/action-setup@v6 |
| 21 | + with: |
| 22 | + version: 10.28.1 |
| 23 | + |
| 24 | + - uses: actions/setup-node@v7 |
| 25 | + with: |
| 26 | + node-version: 24 |
| 27 | + cache: pnpm |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: pnpm install --frozen-lockfile |
| 31 | + |
| 32 | + - name: Verify sealed check hash |
| 33 | + run: | |
| 34 | + actual="$(sha256sum .loop/check.sh | awk '{print $1}')" |
| 35 | + expected="$(sed -n 's/^SHA-256: `\([a-f0-9]*\)`$/\1/p' .loop/task.md)" |
| 36 | + test -n "$expected" |
| 37 | + test "$actual" = "$expected" |
| 38 | +
|
| 39 | + - name: Confirm the setup gate fails by assertion |
| 40 | + run: | |
| 41 | + set +e |
| 42 | + output="$(bash .loop/check.sh 2>&1)" |
| 43 | + status=$? |
| 44 | + set -e |
| 45 | + printf '%s\n' "$output" |
| 46 | + test "$status" -ne 0 |
| 47 | + printf '%s\n' "$output" | grep -F 'ASSERTION FAILED: required precision-protocol file is missing: scripts/source-config.cjs' |
| 48 | +
|
| 49 | + - name: Apply precision protocol changes |
| 50 | + run: | |
| 51 | + base64 -d .loop/apply-precision-patches.cjs.gz.b64 | gzip -d > /tmp/apply-precision-patches.cjs |
| 52 | + node /tmp/apply-precision-patches.cjs |
| 53 | +
|
| 54 | + - name: Regenerate runtime assets |
| 55 | + run: | |
| 56 | + pnpm generate:schema-validators |
| 57 | + pnpm generate:compat-prompts |
| 58 | +
|
| 59 | + - name: Run sealed completion gate |
| 60 | + run: bash .loop/check.sh | tee /tmp/loop-check-output.txt |
| 61 | + |
| 62 | + - name: Record passing gate |
| 63 | + run: | |
| 64 | + { |
| 65 | + printf '\n## Iteration 3 - sealed completion gate - passed\n\n' |
| 66 | + printf '```text\n' |
| 67 | + cat /tmp/loop-check-output.txt |
| 68 | + printf '```\n' |
| 69 | + } >> .loop/journal.md |
| 70 | +
|
| 71 | + - name: Commit verified implementation |
| 72 | + run: | |
| 73 | + git config user.name 'github-actions[bot]' |
| 74 | + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' |
| 75 | + git add -- \ |
| 76 | + .loop/progress.md \ |
| 77 | + .loop/journal.md \ |
| 78 | + .loop/apply-precision-patches.cjs.gz.b64 \ |
| 79 | + .github/workflows/loop-apply.yml \ |
| 80 | + scripts/source-config.cjs \ |
| 81 | + scripts/triage.cjs \ |
| 82 | + scripts/code-index.cjs \ |
| 83 | + scripts/bug-hunter-state.cjs \ |
| 84 | + scripts/chunk-scheduler.cjs \ |
| 85 | + scripts/run-bug-hunter.cjs \ |
| 86 | + scripts/generated-schema-validators.cjs \ |
| 87 | + scripts/tests/run-bug-hunter.test.cjs \ |
| 88 | + scripts/tests/precision-protocol.test.cjs \ |
| 89 | + schemas/findings.schema.json \ |
| 90 | + skills/hunter/SKILL.md \ |
| 91 | + skills/skeptic/SKILL.md \ |
| 92 | + prompts/hunter.md \ |
| 93 | + prompts/skeptic.md \ |
| 94 | + docs/precision-protocol.md \ |
| 95 | + package.json \ |
| 96 | + SKILL.md |
| 97 | + git diff --cached --check |
| 98 | + git commit -m 'loop: iteration 2 - precision-first bug hunting' |
| 99 | + git push origin HEAD:loop/precision-bug-hunting-protocol |
0 commit comments