Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .agents/skills/verify-ci-aggregate/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: verify-ci-aggregate
description: Verify the OSS required CI aggregate against real Bash and GitHub dependency outcomes without hosted jobs or application execution.
---

1. Launch: use a latest-main task worktree. Reuse the repository's locked dev
environment; Bash, jq and Python3 must be available. No service is started.
2. Doctor: confirm this task's current workflow, clean/changed inputs and the
locally available historical commit be0892d55187c2ebb9ee24109020558241eaab14.
Fetch that immutable commit if a shallow checkout lacks it; never reset a
working tree to reproduce the old behavior.
3. Drive: run service-harness inspect, verify and status from the task root.
The behavior helper executes the actual ci-ok shell block with22 fixtures:
successful/scoped-out jobs, unassigned/unfinished/unknown statuses, and missing
or malformed results. Its historical mode reads the real old workflow in
memory. Exit1 proves assertion failures; setup/parse/timeout errors exit2.
4. Evidence: retain the runner's exact source fingerprint, Bash outputs and
expected historical failures outside worktree cleanup. This verifies result
aggregation, not hosted runner capacity, a full application suite or CI/CD
success. Repository protections remain separate.
The pinned runner currently rejects this repository's existing benchmark
submodule directories before gate execution. Preserve them and report the
limitation; manual gate output is not a successful harness receipt. Keep
this correction in progress until required qualification is complete.
5. Cleanup: there are no servers, containers or provider requests. Preserve
unrelated work and remove the task worktree only after actual merge and
clean/pushed/inactive checks. Keep all evidence.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ jobs:
#
# Semantics: `skipped` is a PASS (the path-gated lanes legitimately
# skip when their scope is untouched — see the `changes` job);
# `failure` and `cancelled` are FAILs. `coverage-report` is excluded
# Only `success` and `skipped` are accepted. Missing, unfinished or unknown
# outcomes (including an unassigned runner's `abandoned`) fail closed.
# `coverage-report` is excluded
# by design: it is the informational, non-blocking lane.
ci-ok:
name: CI OK (required status)
Expand All @@ -640,13 +642,18 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Verify no needed job failed or was cancelled
- name: Verify needed jobs succeeded or were intentionally skipped
env:
RESULTS: ${{ toJSON(needs) }}
run: |
echo "$RESULTS" | jq -r 'to_entries[] | "\(.key): \(.value.result)"'
bad=$(echo "$RESULTS" | jq -r '[to_entries[] | select(.value.result == "failure" or .value.result == "cancelled")] | length')
bad=$(echo "$RESULTS" | jq -er '
if type != "object" or length == 0 then
error("Expected a nonempty GitHub needs result object")
else
[to_entries[] | select(.value.result != "success" and .value.result != "skipped")] | length
end')
if [ "$bad" != "0" ]; then
echo "::error::$bad required job(s) failed or were cancelled."
echo "::error::$bad required job(s) did not succeed or intentionally skip."
exit 1
fi
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ release or require a version bump. SaaS identifiers remain independent.

Use Axum when adding or porting Rust HTTP server code.

# Required CI results

| Rule | Enforcement |
|---|---|
| CI aggregation accepts only success or intentional skipped results; incomplete, unknown and missing results fail. | Actual workflow Bash exercised by tests/ci/test_ci_aggregate.py, including the historical abandoned-run reproduction. |

<!-- entire-agent:begin -->
Read .entire/agent-guide.md for this repository's workflow, source inspection, and verification guidance.
@.entire/agent-guide.md
Expand Down
2 changes: 2 additions & 0 deletions CHAGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Keep proposed and unmerged changes out of released sections.

## [Unreleased]

- Proposed CI verification correction ([#1210](https://github.com/BitterSecurity/Decepticon/pull/1210)): require every declared dependency to succeed or intentionally skip before CI OK passes. Reject abandoned, unknown and missing outcomes while preserving existing scope skips and protections. This corrects a false-positive aggregate after a hosted macOS runner could not be assigned; runner availability and actual hosted CI remain separate. [Verification](docs/verification/ci-required-terminal-results-20261120.md).

- Proposed [PR #1209](https://github.com/BitterSecurity/Decepticon/pull/1209) on the rust-anything streaming text experiment. Recorded parity held for 231 cases, while the Node native binding was slower in the local microbenchmark. See the [measured results](docs/verification/rust-anything-streaming-text-20261120.md).

- Live-capture qualification ([#1206](https://github.com/BitterSecurity/Decepticon/pull/1206)) for [#1198](https://github.com/BitterSecurity/Decepticon/pull/1198), unreleased: the public README-only Codex session is actually recorded with one completed turn and zero pending turns. Preserve local-only checkpoint policy, generated hook bytes, trust records and the canonical OSS checkout. No runtime/package/release change; process exit and commit checkpoint creation are not claimed. [Evidence](docs/operations/entire-public-live-capture-20261118.json).
Expand Down
43 changes: 43 additions & 0 deletions docs/verification/ci-required-terminal-results-20261120.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Required CI aggregate rejects incomplete outcomes

Actual main run44314841378 at be0892d5 failed when GitHub could not assign the
Launcher macOS runner. The platform reported the job cancelled and supplied
`launcher.result = abandoned` to the required aggregate. Its blacklist checked
only failure/cancelled, so CI OK incorrectly succeeded. Runner capacity is a
separate infrastructure issue; this change does not claim to repair it.

Accept only success and intentionally skipped dependencies. Refuse all other
results and empty input objects. Preserve the existing dependency set, scope
skips, matrix, permissions, pinned actions and workflow triggers. No package,
application, publishing or release-version changes are introduced.

The standalone helper executes the actual workflow Bash block with22 fixtures
in three unittest methods. Before the correction,13 bad inputs falsely passed,
including the actual abandoned result. The fixed source preserves all three
successful/scoped-out fixtures and rejects all19 bad fixtures. Historical mode
loads the real immutable pre-fix shell in memory; assertion failures exit1 and
infrastructure/parse/timeout errors exit2. No source reset or synthetic CI status
is used. The same aggregation commands run locally and in the hosted workflow.

Ruff, formatting, narrow type checking, workflow YAML parsing and the executable
source/historical assertions are local checks. Hosted runner availability,
full application tests/builds and hosted CI success are separate and are not
claimed by this scoped correction. No application server, target, provider or
production deployment is needed to verify result aggregation.

The service-harness contract and project-local verification skill describe the
required gates. Qualification by the pinned runner is still blocked: inspect
and verify exit2 before running any gate with `Submodules need an explicit
verification contract: benchmark/MHBench`. These existing benchmark gitlinks
are unrelated to this correction. The pinned Rust source rejects directory
inputs in workspace snapshotting, and its contract schema exposes no submodule
contract field. No benchmark, index entry, runner or protection was modified to
bypass this limitation. Status has no receipt to read. Manual gate results are
recorded separately and are not represented as a successful harness receipt.

The later documentation-only main run44573832461 actually succeeded, including
all three Launcher platforms. Its Python/Docker/telemetry lanes intentionally
skipped according to scope. That result does not reproduce or negate the older
runner failure, nor does it qualify this proposed correction. The Entire Brain
seed is older and returned no durable intent evidence for this defect; actual
GitHub job/aggregate logs and current source establish the reported behavior.
33 changes: 33 additions & 0 deletions service-harness.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version = 1
intent = "Require every declared CI dependency to succeed or intentionally skip; reject abandoned, unknown and missing results without weakening scope skips or repository protections."

[[gates]]
id = "ci-aggregate-lint"
kind = "static"
argv = [".venv/bin/ruff", "check", "tests/ci/test_ci_aggregate.py"]
timeout_seconds = 30

[[gates]]
id = "ci-aggregate-format"
kind = "static"
argv = [".venv/bin/ruff", "format", "--check", "tests/ci/test_ci_aggregate.py"]
timeout_seconds = 30

[[gates]]
id = "ci-aggregate-behavior"
kind = "behavior"
argv = ["python3", "tests/ci/test_ci_aggregate.py"]
timeout_seconds = 30

[gates.regression]
argv = ["python3", "tests/ci/test_ci_aggregate.py", "--historical"]
expected_exit = 1

[[flows]]
id = "required-ci-terminal-results"
behavior = "The real workflow shell accepts successful and scoped-out jobs while refusing every other observed or future result."
gate = "ci-aggregate-behavior"
entrypoints = [".github/workflows/ci.yml jobs.ci-ok"]
preconditions = ["Bash and jq installed", "Historical immutable source available locally"]
actions = ["Execute actual workflow shell with 22 dependency-result fixtures", "Run identical assertions against the real historical shell"]
expected = ["success and skipped remain accepted", "abandoned and all other non-success outcomes fail", "Missing or malformed results fail", "Infrastructure errors cannot establish a historical regression"]
150 changes: 150 additions & 0 deletions tests/ci/test_ci_aggregate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
"""Execute the real CI aggregation shell with GitHub dependency outcomes."""

from __future__ import annotations

import argparse
import json
import os
import re
import shutil
import subprocess
import sys
import unittest
from pathlib import Path
from typing import ClassVar

ROOT = Path(__file__).resolve().parents[2]
HISTORICAL_COMMIT = "be0892d55187c2ebb9ee24109020558241eaab14"
HISTORICAL = False
JOBS = (
"changes",
"compose-validate",
"python",
"cli",
"launcher",
"docker-build",
"docker-build-arm64",
"security",
"telemetry",
"actionlint",
)


def aggregate_script(historical: bool) -> str:
"""Read the single literal shell block in the actual ci-ok job.
This deliberately accepts only this job's existing shape, rather than
pretending to parse arbitrary YAML. A changed/ambiguous shape is an
infrastructure error, never a successful historical reproduction.
"""
for binary in ("bash", "jq"):
if shutil.which(binary) is None:
raise RuntimeError(f"Required local executable missing: {binary}")
content = (
subprocess.check_output(
["git", "show", f"{HISTORICAL_COMMIT}:.github/workflows/ci.yml"],
cwd=ROOT,
text=True,
)
if historical
else (ROOT / ".github/workflows/ci.yml").read_text()
)
lines = content.splitlines()
starts = [i for i, line in enumerate(lines) if line == " ci-ok:"]
if len(starts) != 1:
raise RuntimeError("Expected exactly one ci-ok job")
start = starts[0]
end = next(
(i for i in range(start + 1, len(lines)) if re.match(r"^ [\w-]+:", lines[i])),
len(lines),
)
job = lines[start:end]
blocks = [i for i, line in enumerate(job) if line == " run: |"]
if len(blocks) != 1:
raise RuntimeError("Expected one literal aggregation shell block")
body: list[str] = []
for line in job[blocks[0] + 1 :]:
if line and not line.startswith(" "):
break
body.append(line[10:] if line else "")
script = "\n".join(body)
if not script.strip():
raise RuntimeError("Aggregation shell block is empty")
subprocess.run(["bash", "-n", "-c", script], check=True, capture_output=True)
return script


class CiAggregateTests(unittest.TestCase):
script: ClassVar[str]

@classmethod
def setUpClass(cls) -> None:
cls.script = aggregate_script(HISTORICAL)

def assert_outcome(self, payload: str, expected: bool) -> None:
result = subprocess.run(
["bash", "-e", "-c", self.script],
cwd=ROOT,
env={**os.environ, "RESULTS": payload},
capture_output=True,
text=True,
timeout=5,
)
if result.returncode in (126, 127):
raise RuntimeError("Aggregation shell could not execute a required command")
self.assertEqual(result.returncode == 0, expected, result.stdout + result.stderr)

def test_success_and_intentional_scope_skips(self) -> None:
for status in ("success", "skipped"):
with self.subTest(status=status):
self.assert_outcome(
json.dumps({job: {"result": status, "outputs": {}} for job in JOBS}),
True,
)
mixed = {job: {"result": "success"} for job in JOBS}
for job in ("python", "docker-build", "docker-build-arm64", "telemetry"):
mixed[job] = {"result": "skipped"}
self.assert_outcome(json.dumps(mixed), True)

def test_unfinished_and_unknown_outcomes_are_refused(self) -> None:
for status in (
"failure",
"cancelled",
"abandoned",
"timed_out",
"neutral",
"stale",
"action_required",
"queued",
"in_progress",
"unknown",
"",
):
with self.subTest(status=status):
needs = {job: {"result": "success"} for job in JOBS}
needs["launcher"] = {"result": status}
self.assert_outcome(json.dumps(needs), False)

def test_missing_or_invalid_results_are_refused(self) -> None:
for payload in (
"{}",
"[]",
"null",
'"success"',
"not json",
"",
'{"launcher":{}}',
'{"launcher":{"result":null}}',
):
with self.subTest(payload=payload):
self.assert_outcome(payload, False)


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--historical", action="store_true")
HISTORICAL = parser.parse_args().historical
suite = unittest.defaultTestLoader.loadTestsFromTestCase(CiAggregateTests)
outcome = unittest.TextTestRunner(verbosity=2).run(suite)
# Setup, executable, parse and timeout errors cannot prove a regression.
sys.exit(2 if outcome.errors else 0 if outcome.wasSuccessful() else 1)
Loading