Skip to content

feat(tooling): ci-precheck.sh + CI-RUNBOOK.md#146

Merged
Delqhi merged 4 commits into
mainfrom
feat/ci-precheck-tooling
Jun 16, 2026
Merged

feat(tooling): ci-precheck.sh + CI-RUNBOOK.md#146
Delqhi merged 4 commits into
mainfrom
feat/ci-precheck-tooling

Conversation

@Delqhi

@Delqhi Delqhi commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

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 executable
  • scripts/ci-precheck.sh.doc.md — CoDoc explaining what the script does/doesn't
  • docs/CI-RUNBOOK.md — long-form operating manual (workflow anatomy, failure patterns, recovery, branch-protection evolution)

Test plan

  • bash -n scripts/ci-precheck.sh — syntax valid
  • chmod +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.
  • All other steps degrade gracefully when the tool is missing (report as skipped, don't fail).

CI

Both new files are documentation/script; they don't change Go behavior. The scripts/ci-precheck.sh is its own consumer of the §13.2 checklist. Expect all four blocking workflows green.

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.
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sin-code Ready Ready Preview, Comment, Open in v0 Jun 16, 2026 12:51am

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

🏆 CEO Audit — A+ (100.0/100)

Metric Value
Grade A+
Score 100.0/100
Critical findings 0
High findings 0
Profile QUICK
Min grade gate B

📥 Download full report (Markdown)
📊 Download SARIF (for Code Scanning)

Run ~/.config/opencode/skills/ceo-audit/scripts/audit.sh . --profile=QUICK locally to reproduce.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

🏆 CEO Audit — A+ (100.0/100)

Metric Value
Grade A+
Score 100.0/100
Critical findings 0
High findings 0
Medium findings 0
Profile QUICK
Min grade gate B

📥 Download full report (Markdown)

Run ID: 27586482260 · Commit: ${github.sha}

Run ~/.config/opencode/skills/ceo-audit/scripts/audit.sh . --profile=QUICK locally to reproduce.

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
Delqhi merged commit a89b75a into main Jun 16, 2026
9 of 10 checks passed
@Delqhi
Delqhi deleted the feat/ci-precheck-tooling branch June 16, 2026 01:00
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants