Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fa0deec
test(sdga): require actual kernel replay and duplicate-base refusal b…
d6g8k5htny-coder Nov 10, 2026
2850d98
test(sdga): require actual public replay CLI success alongside shared…
d6g8k5htny-coder Nov 10, 2026
9607199
feat(sdga): replay complete owned constants through guarded upstream …
d6g8k5htny-coder Nov 10, 2026
5fffd15
merge: preserve fresh Q806 Main and qualified kernel replay history w…
d6g8k5htny-coder Nov 10, 2026
abf423e
test(sdga): require raw extras and IR provenance before implementation
d6g8k5htny-coder Nov 10, 2026
56b792f
test: stage Main unittest qualification contracts before helper
d6g8k5htny-coder Nov 10, 2026
58454c5
merge: preserve Main804 peer source and complete qualified SDGA kerne…
d6g8k5htny-coder Nov 10, 2026
ccb98a3
Bound G11 Python subprocess option operands
d6g8k5htny-coder Nov 10, 2026
d51700e
Expand G11 operand controls and preserve hosted evidence
d6g8k5htny-coder Nov 10, 2026
cff2314
Merge pull request #807 from d6g8k5htny-coder/codex/cbz-sdga-kernel-t…
d6g8k5htny-coder Nov 10, 2026
d72365a
Compose G11 subprocess repair over Main 807
d6g8k5htny-coder Nov 10, 2026
d1819f0
Merge pull request #810 from d6g8k5htny-coder/codex/cbz-g11-subproces…
d6g8k5htny-coder Nov 10, 2026
9e0c6c5
Record integrated CBZ observations and prepared Pages evidence
d6g8k5htny-coder Nov 10, 2026
bb7cb5f
feat: implement Stage 1 unittest qualification contracts
d6g8k5htny-coder Nov 10, 2026
1ce3eda
Correct G11 findings counts and retain source-bound reports
d6g8k5htny-coder Nov 10, 2026
1b1885a
feat(sdga): retain raw extras and separate IR evidence
d6g8k5htny-coder Nov 10, 2026
b285dd7
Merge pull request #811 from d6g8k5htny-coder/codex/cbz-integrated-ob…
d6g8k5htny-coder Nov 10, 2026
63908a0
chore(sdga): preserve fresh Main and initial Task D evidence
d6g8k5htny-coder Nov 10, 2026
02973f3
Merge pull request #808 from d6g8k5htny-coder/codex/cbz-sdga-extras-i…
d6g8k5htny-coder Nov 10, 2026
b574a30
feat: compose Stage 1 qualification helper with fresh Main and retain…
d6g8k5htny-coder Nov 10, 2026
1eb7765
ci: expose original navigation failure bytes without changing tests
d6g8k5htny-coder Nov 10, 2026
9043612
fix: keep navigation evidence outside checked source
d6g8k5htny-coder Nov 10, 2026
9ad2edf
fix: inherit bytecode suppression in navigation children
d6g8k5htny-coder Nov 10, 2026
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
224 changes: 224 additions & 0 deletions .github/workflows/full-unittest-qualification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
name: Main unittest Stage 1 contracts

'on':
pull_request:
paths:
- tests/test_unittest_full_qualification.py
- tools/unittest_full_qualification.py
- .github/workflows/full-unittest-qualification.yml
- docs/superpowers/plans/2026-11-10-main-unittest-stage1-testfirst.md
workflow_dispatch:

permissions:
contents: read

jobs:
targeted:
name: Stage 1 targeted contracts (${{ matrix.mode }})
runs-on: ubuntu-24.04
timeout-minutes: 12
strategy:
fail-fast: false
matrix:
mode: [normal, optimized]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.11'
- name: Observe only the new behavioral contracts from this checked source
timeout-minutes: 10
env:
STAGE1_MODE: ${{ matrix.mode }}
run: |
set -euo pipefail
python3 -I -B -S - "$RUNNER_TEMP" "$GITHUB_WORKSPACE" <<'PY'
import hashlib, json, os, pathlib, re, signal, stat, subprocess, sys
root = pathlib.Path(sys.argv[2]).resolve()
mode = os.environ["STAGE1_MODE"]
if mode not in ("normal", "optimized"):
raise ValueError("unknown Stage 1 mode")
run_id, attempt = os.environ["GITHUB_RUN_ID"], os.environ["GITHUB_RUN_ATTEMPT"]
if not all(re.fullmatch(r"[1-9][0-9]*", value) for value in (run_id, attempt)):
raise ValueError("invalid native run identity")
out = pathlib.Path(sys.argv[1]) / ("main-unittest-stage1-" + mode + "-" + run_id + "-" + attempt)
out.mkdir(mode=0o700, exist_ok=False)
protected = {
".github/workflows/research-architecture.yml": "69ad3b47537ab8e4f8936affa3e09fccbdcfd1e5",
"tools/unittest_timing_probe.py": "05fb481b5538c3f517174b00948de45d2849387a",
"tools/architecture_run_receipt.py": "a6062afa9261958b8d8b85853a9c43031385b2c1",
"architecture/graph_artifact_readback.py": "c39ffd0fdcde1fd5f895c57df5f770a582918a8a",
"tools/architecture_check_binding.py": "53ea34e4fffc1087770584744939904844a41cff",
}
def write(name, value):
with (out / name).open("x", encoding="ascii", newline="\n") as stream:
json.dump(value, stream, sort_keys=True, ensure_ascii=True, allow_nan=False)
stream.write("\n")
def git(*args):
environment = {key: value for key, value in os.environ.items() if not key.startswith("GIT_")}
environment.update(GIT_CONFIG_NOSYSTEM="1", GIT_CONFIG_GLOBAL=os.devnull,
GIT_OPTIONAL_LOCKS="0")
return subprocess.check_output(
["git", "--no-replace-objects", "-c", "core.fsmonitor=false",
"-c", "core.hooksPath=/dev/null", "-C", str(root), *args], env=environment)
def source():
head = git("rev-parse", "--verify", "HEAD").decode("ascii").strip()
tree = git("rev-parse", "--verify", "HEAD^{tree}").decode("ascii").strip()
if head != os.environ["GITHUB_SHA"]:
raise ValueError("checked HEAD differs from native GITHUB_SHA")
if pathlib.Path(git("rev-parse", "--show-toplevel").decode().strip()).resolve() != root:
raise ValueError("source is not the actual Git top-level")
rows = []
for item in git("ls-tree", "-r", "--full-tree", "-z", head).split(b"\0"):
if not item:
continue
metadata, raw_path = item.split(b"\t", 1)
mode_bits, kind, blob = metadata.decode("ascii").split()
relative = raw_path.decode("utf-8")
path = root / relative
info = path.lstat()
if kind != "blob" or mode_bits not in ("100644", "100755") or not stat.S_ISREG(info.st_mode):
raise ValueError("non-regular tracked source: " + relative)
if bool(info.st_mode & stat.S_IXUSR) != (mode_bits == "100755"):
raise ValueError("changed source executable mode: " + relative)
raw = path.read_bytes()
actual_blob = hashlib.sha1(b"blob " + str(len(raw)).encode("ascii") + b"\0" + raw).hexdigest()
if actual_blob != blob or (relative in protected and blob != protected[relative]):
raise ValueError("changed tracked/protected source: " + relative)
rows.append(dict(path=relative, mode=mode_bits, git_blob=blob,
bytes=len(raw), sha256=hashlib.sha256(raw).hexdigest()))
if set(protected) - {row["path"] for row in rows}:
raise ValueError("missing protected source")
untracked = git("ls-files", "--others", "--exclude-standard", "-z")
ignored = git("ls-files", "--others", "--ignored", "--exclude-standard", "-z")
if untracked or ignored:
raise ValueError("unexpected untracked or ignored checkout input")
return dict(repository=os.environ["GITHUB_REPOSITORY"], checked_commit=head,
checked_tree=tree, run_id=run_id, run_attempt=attempt, files=rows)
record = dict(scope="STAGE1_TARGETED_BEHAVIORAL_CONTRACTS_ONLY", mode=mode,
full_discovery_run=False, architecture_run=False, g5_claim=False, cbz_claim=False)
before = None
process = None
try:
before = source()
write("source-before.json", before)
command = [sys.executable, "-B"] + (["-O"] if mode == "optimized" else [])
command += ["-S", "-m", "unittest", "discover", "-s", "tests",
"-p", "test_unittest_full_qualification.py", "-v"]
environment = dict(os.environ)
for name in ("PYTHONPATH", "PYTHONHOME", "PYTHONOPTIMIZE"):
environment.pop(name, None)
environment.update(PYTHONDONTWRITEBYTECODE="1", PYTHONNOUSERSITE="1")
record["command"] = command
record["cwd"] = str(root)
with (out / "stdout.bin").open("xb") as stdout, (out / "stderr.bin").open("xb") as stderr:
process = subprocess.Popen(command, cwd=root, env=environment, stdout=stdout,
stderr=stderr, start_new_session=True)
try:
code = process.wait(timeout=480)
record["timed_out"] = False
except subprocess.TimeoutExpired:
record["timed_out"] = True
os.killpg(process.pid, signal.SIGTERM)
try:
process.wait(timeout=10)
except subprocess.TimeoutExpired:
os.killpg(process.pid, signal.SIGKILL)
process.wait(timeout=10)
code = process.returncode
record["native_exit_code"] = code
after = source()
write("source-after.json", after)
record["source_unchanged"] = before == after
text = (out / "stderr.bin").read_bytes().decode("utf-8", errors="replace")
methods = (
"test_native_pattern_censuses_select_actual_membership_not_id_prefix",
"test_fresh_pattern_dependent_load_tests_disagreement_refuses_before_body",
"test_safe_original_cases_preserve_fixture_lifecycle_and_unsafe_suites_refuse",
"test_omitted_duplicate_extra_zero_and_import_failed_inventories_refuse",
"test_all_actual_parent_fixture_and_subtest_non_successes_cannot_qualify",
"test_interrupted_incomplete_nonzero_and_damaged_journals_cannot_qualify",
"test_source_runtime_closed_records_stale_context_and_missing_producers_refuse",
"test_real_unchanged_reader_accepts_only_labelled_test_archive_then_exact_join_membership",
"test_original_zip_member_bytes_and_inert_api_bindings_are_both_checked",
"test_pilot_success_can_never_produce_main_discovery_qualification",
)
owner = "test_unittest_full_qualification.MainUnittestQualificationContract."
expected_ids = [owner + method for method in sorted(methods)]
observed_ids, bad_results, malformed_results = [], [], []
for line in text.splitlines():
if " ... " not in line and not line.startswith("test"):
continue
result = re.fullmatch(r"(\S+) \(([^()]*)\) \.\.\. (.+)", line)
if result is None:
malformed_results.append(line)
continue
short, identity, disposition = result.groups()
observed_ids.append(identity)
if short != identity.rsplit(".", 1)[-1] or disposition != "ok":
bad_results.append(line)
summaries = re.findall(
r"^Ran ([1-9][0-9]*) tests? in [0-9]+(?:\.[0-9]+)?s$", text, re.M)
nonempty = [line for line in text.splitlines() if line.strip()]
record["expected_parent_ids"] = expected_ids
record["observed_parent_ids"] = observed_ids
record["bad_result_lines"] = bad_results
record["malformed_result_lines"] = malformed_results
record["reported_test_count"] = int(summaries[0]) if len(summaries) == 1 else None
record["exact_parent_results"] = (
observed_ids == expected_ids and not bad_results and not malformed_results
and len(summaries) == 1 and int(summaries[0]) == len(expected_ids))
record["terminal_ok"] = bool(nonempty and nonempty[-1] == "OK")
accepted = (code == 0 and before == after and not record["timed_out"]
and record["exact_parent_results"] and record["terminal_ok"])
record["outcome"] = "PASS" if accepted else "FAIL"
except Exception as error:
record["outcome"] = "FAIL"
record["controller_error"] = type(error).__name__ + ": " + str(error)
finally:
if process is not None and process.poll() is None:
os.killpg(process.pid, signal.SIGKILL)
process.wait(timeout=10)
for name in ("stdout.bin", "stderr.bin"):
path = out / name
if path.is_file():
raw = path.read_bytes()
record[name] = dict(bytes=len(raw), sha256=hashlib.sha256(raw).hexdigest())
marker = os.urandom(24).hex()
print("::stop-commands::" + marker, flush=True)
try:
for name in ("stdout.bin", "stderr.bin"):
path = out / name
if not path.is_file():
print("STAGE1_STREAM_NOT_PRODUCED", name, flush=True)
continue
raw = path.read_bytes()
prefix = raw[:65536]
print("STAGE1_ORIGINAL_STREAM_PREFIX", mode, name,
"original_bytes=" + str(len(raw)),
"original_sha256=" + hashlib.sha256(raw).hexdigest(),
"printed_prefix_bytes=" + str(len(prefix)), flush=True)
sys.stdout.buffer.write(prefix)
if prefix and not prefix.endswith(b"\n"):
sys.stdout.buffer.write(b"\n")
sys.stdout.buffer.flush()
if len(raw) > len(prefix):
print("STAGE1_PRINT_TRUNCATED", name,
"full_original_retained_in_artifact=true", flush=True)
finally:
print("::" + marker + "::", flush=True)
write("observation.json", record)
print(json.dumps(record, sort_keys=True))
raise SystemExit(0 if record["outcome"] == "PASS" else 1)
PY
- name: Retain original targeted observation including honest absence RED
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: main-unittest-stage1-${{ matrix.mode }}-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/main-unittest-stage1-${{ matrix.mode }}-${{ github.run_id }}-${{ github.run_attempt }}/
if-no-files-found: error
retention-days: 30
Loading
Loading