feat(tooling): ci-precheck.sh + CI-RUNBOOK.md#146
Merged
Conversation
Adds the two artifacts AGENTS.md §13.6 + §13.7 reference: - scripts/ci-precheck.sh: mirror of the §13.2 pre-PR checklist as an executable. Runs gofmt (scoped to cmd/sin-code/), go build, go vet, validate_skill.py --strict, go test (no race), golangci-lint, govulncheck, gosec SARIF, ceo-audit. --fast skips go test and ceo-audit. --pr <N> additionally polls the remote PR and exits non-zero if a required check is red. Graceful degradation: missing tools (gosec, golangci-lint, etc.) are reported as skipped, not failures. - scripts/ci-precheck.sh.doc.md: CoDoc explaining what the script does, what it does NOT do (no -race, no gosec exit-code gating), exit code semantics, and tool-by-tool install commands. - docs/CI-RUNBOOK.md: long-form operating manual behind §13. Per-workflow anatomy (lint-and-security, go-ci, ceo-audit, ci), locally-reproduced failure patterns (gofmt, undefined, gosec SARIF, go test timeout, ceo-audit grade), recovery steps (stuck pending, flaky tests, OOM kills), branch-protection evolution (how to add a new required check). Mirror of the global ~/.config/opencode/AGENTS.md §13.6 + §13.7 which the agent reads at every cold start.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown)
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown) Run ID:
|
…verage tests behind coverage tag
…t-forwarding main
| var adversaryExecCommand = func(ctx context.Context, workdir, rel string, timeout time.Duration) ([]byte, error) { | ||
| cctx, cancel := context.WithTimeout(ctx, timeout) | ||
| defer cancel() | ||
| cmd := exec.CommandContext(cctx, "go", "test", "-run", "TestAdversary", "-count=1", "./"+rel) |
| // kernelGitOutCmd runs git in the kernel workdir and returns stdout. | ||
| // Tests override this hook to avoid spawning real subprocesses. | ||
| var kernelGitOutCmd = func(ctx context.Context, dir string, args ...string) ([]byte, error) { | ||
| cmd := exec.CommandContext(ctx, "git", args...) |
|
|
||
| // mutationExecCommand is a hook for the mutation probe test command. | ||
| var mutationExecCommand = func(ctx context.Context, workdir string, args ...string) error { | ||
| cmd := exec.CommandContext(ctx, args[0], args[1:]...) |
| if data, err := os.ReadFile(p); err == nil { | ||
| return string(data), nil | ||
| if p != "" { | ||
| data, err := os.ReadFile(p) |
| // specWorktreeAdd runs `git worktree add` in a repo root. Tests override this | ||
| // hook to avoid spawning real subprocesses. | ||
| var specWorktreeAdd = func(ctx context.Context, repoRoot, dir string) ([]byte, error) { | ||
| cmd := exec.CommandContext(ctx, "git", "worktree", "add", "--detach", dir) |
Delqhi
added a commit
that referenced
this pull request
Jun 16, 2026
Four new doc files, one per subsystem that landed in PRs #144 (feat/learning-subsystem) and #146 (ci-precheck tooling): - docs/INSTINCTS.md: how the continuous-learning loop works, confidence math (0.3-0.9 with diminishing returns), per-project storage keyed on SHA-256(normalized git remote), the 10 sin instinct subcommands, the closed-loop wiring (Observer → Extractor → Manager → SystemBlockForProject) - docs/HOOKS-NEW.md: the native Go hook subsystem (PreToolUse may Block, other phases aggregate Warn), the 7 built-in hooks, per-hook timeout + panic recovery, how to add a new hook, why two hook systems coexist (this one + the legacy user-configurable YAML one in docs/HOOKS.md) - docs/EVAL-HARNESS.md: the eval-driven development harness, EvalSet/Run/Result data model, the 5 built-in Scorers (exact, contains-all, success-flag, LLM-judge, composite), JSONL run history, Compare for case-by-case regression detection with --fail-on-regress as a CI gate. Distinguishes from the older 'sin eval' Golden-Dataset runner. - docs/PRP-WORKFLOW.md: the Product Requirement Prompt workflow, draft -> planned -> implementing -> verifying -> ready -> shipped phase machine, per-step persistence, the four collaborators (Planner, Implementer, Verifier, PRController), the file format, common failure modes. All four are referenced from the new AGENTS.md section 14 (subsystem deep-dives) in both the global ~/.config/opencode/AGENTS.md and the Infra-SIN-OpenCode-Stack repo's AGENTS.md. The cold-start checklist in §14.6 tells new agents to read them in this order: §1-12 -> §13 -> CI-RUNBOOK §3 -> HOOKS-NEW -> INSTINCTS -> EVAL-HARNESS -> PRP-WORKFLOW Reading all seven is 30 minutes; skipping them is the #1 cause of agent mistakes on this codebase. Co-authored-by: SIN CI <ci@opensin-code.local>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds the two artifacts AGENTS.md §13.6 + §13.7 reference:
scripts/ci-precheck.sh— mirror of the §13.2 pre-PR checklist as an executablescripts/ci-precheck.sh.doc.md— CoDoc explaining what the script does/doesn'tdocs/CI-RUNBOOK.md— long-form operating manual (workflow anatomy, failure patterns, recovery, branch-protection evolution)Test plan
bash -n scripts/ci-precheck.sh— syntax validchmod +x scripts/ci-precheck.sh && ls -la scripts/ci-precheck.sh— executable./scripts/ci-precheck.sh --fast— runs gofmt (scoped to cmd/sin-code/), go build, go vet, validate_skill.py, govulncheck. Found 1 unformatted file from a parallel session (notifications/dispatch.go) — exactly the failure pattern §3.1 of the runbook describes.skipped, don't fail).CI
Both new files are documentation/script; they don't change Go behavior. The
scripts/ci-precheck.shis its own consumer of the §13.2 checklist. Expect all four blocking workflows green.