From 3031e4881004293e545445acea3b0667bbd8a8bd Mon Sep 17 00:00:00 2001 From: "rizzstack-coordinator[bot]" <362099543+rizzstack-coordinator[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 21:07:35 -0500 Subject: [PATCH 1/3] lease(obs-ci-runs-handoff): land the approved contract ed0fa7b5 and lease --- ...1853f56217389abdaf2c69cbee8210f026f9f.json | 289 ++++++++++++++++++ .rizzstack/leases/obs-ci-runs-handoff.json | 62 ++++ 2 files changed, 351 insertions(+) create mode 100644 .rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json create mode 100644 .rizzstack/leases/obs-ci-runs-handoff.json diff --git a/.rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json b/.rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json new file mode 100644 index 0000000..7e65398 --- /dev/null +++ b/.rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json @@ -0,0 +1,289 @@ +{ + "acceptance_criteria": [ + { + "id": "AC-001", + "statement": "Point 1, builder: observability/ci_runs.py turns a `gh run view --json` run document and a `gh run view --json jobs` document into ci.run/v1 rows, one row per job in job order and no row for a run with no jobs; a bare jobs list builds the same rows as the {'jobs': [...]} document; every row validates against the merged observability/schemas/ci-run.schema.json, names schema ci.run/v1 and schema_version v1, and records the run's attempt (1 when the run document carries none). The builder is pure over its arguments: no file, network or subprocess read.", + "tests": [ + "observability/tests/test_ci_runs.py::RowShapeTests::test_one_row_per_job_in_job_order", + "observability/tests/test_ci_runs.py::RowShapeTests::test_every_row_validates_against_the_merged_schema", + "observability/tests/test_ci_runs.py::RowShapeTests::test_the_jobs_document_and_a_bare_list_build_the_same_rows", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_run_with_no_jobs_builds_no_rows", + "observability/tests/test_ci_runs.py::RowShapeTests::test_the_row_records_the_run_attempt", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_run_without_an_attempt_is_attempt_one", + "observability/tests/test_ci_runs.py::RowShapeTests::test_every_row_names_the_schema_and_its_version" + ], + "verification": "test" + }, + { + "id": "AC-002", + "statement": "Point 2, shards: parse_shard() reads a trailing ` (i/n)` marker from a job name and returns {'index': i, 'total': n}; a name without a marker, a trailing parenthetical that is not a fraction, and an index outside 1..total all return None. Because the merged schema types shard as integer|null and forbids additional properties, the row carries the shard INDEX (test (3/8) -> 3) and null when the name has no marker; the total lives only in parse_shard's result.", + "tests": [ + "observability/tests/test_ci_runs.py::ShardParseTests::test_a_sharded_job_name_parses_its_index_and_total", + "observability/tests/test_ci_runs.py::ShardParseTests::test_a_job_name_without_a_marker_parses_to_none", + "observability/tests/test_ci_runs.py::ShardParseTests::test_a_parenthetical_that_is_not_a_fraction_is_not_a_shard", + "observability/tests/test_ci_runs.py::ShardParseTests::test_an_index_outside_its_total_is_not_a_shard", + "observability/tests/test_ci_runs.py::ShardRowTests::test_a_row_carries_the_shard_index_as_an_integer", + "observability/tests/test_ci_runs.py::ShardRowTests::test_a_row_without_a_marker_has_a_null_shard" + ], + "verification": "test" + }, + { + "id": "AC-003", + "statement": "Point 3, timings: queued_s = startedAt - createdAt and duration_s = completedAt - startedAt, in seconds, compared as instants so a timestamp with an offset is the same instant as its UTC form; a missing or unparseable timestamp yields null, never 0, and a completedAt before startedAt yields null, never a negative number; a running job has queued_s and a null duration_s; the row's ts is the job's completedAt, else its startedAt, else its createdAt, else the run's createdAt; a job that still cannot be timestamped is refused with ValueError rather than emitted untimestamped. timestamp_delta(start, end) is the pure helper with that contract.", + "tests": [ + "observability/tests/test_ci_runs.py::TimingTests::test_queued_seconds_is_the_wait_from_created_to_started", + "observability/tests/test_ci_runs.py::TimingTests::test_duration_seconds_is_the_time_from_started_to_completed", + "observability/tests/test_ci_runs.py::TimingTests::test_a_missing_started_at_yields_null_never_zero", + "observability/tests/test_ci_runs.py::TimingTests::test_a_running_job_has_a_null_duration_and_its_start_as_ts", + "observability/tests/test_ci_runs.py::TimingTests::test_a_completed_at_before_started_at_is_null_not_negative", + "observability/tests/test_ci_runs.py::TimingTests::test_a_job_without_a_timestamp_takes_the_run_created_at_as_ts", + "observability/tests/test_ci_runs.py::TimingTests::test_a_row_that_cannot_be_timestamped_is_refused", + "observability/tests/test_ci_runs.py::DeltaTests::test_the_delta_helper_is_null_when_either_end_is_missing", + "observability/tests/test_ci_runs.py::DeltaTests::test_the_delta_helper_is_null_for_an_unparseable_timestamp", + "observability/tests/test_ci_runs.py::DeltaTests::test_the_delta_helper_compares_offsets_as_instants", + "observability/tests/test_ci_runs.py::DeltaTests::test_the_delta_helper_refuses_a_negative_delta" + ], + "verification": "test" + }, + { + "id": "AC-004", + "statement": "Point 4, flake: the builder takes an optional list of earlier attempts of the same run ({attempt, headSha, jobs}), considers only attempts whose headSha equals the row's sha, and marks flake true for every row of a job that concluded failure on one attempt and success on a later attempt at that sha (the failed attempt's own row carries the same true). A single failed attempt that never passed, a job that passed first time, and a cancelled attempt followed by a pass are all false. The attempts list never adds rows: the rows are exactly the jobs of the run under test.", + "tests": [ + "observability/tests/test_ci_runs.py::FlakeTests::test_a_failure_then_a_pass_on_the_next_attempt_is_a_flake", + "observability/tests/test_ci_runs.py::FlakeTests::test_the_failed_attempt_of_a_flaking_job_also_carries_the_flake", + "observability/tests/test_ci_runs.py::FlakeTests::test_a_single_failure_that_never_passed_is_not_a_flake", + "observability/tests/test_ci_runs.py::FlakeTests::test_a_job_that_passed_first_time_is_not_a_flake", + "observability/tests/test_ci_runs.py::FlakeTests::test_a_cancelled_attempt_then_a_pass_is_not_a_flake", + "observability/tests/test_ci_runs.py::FlakeTests::test_an_attempt_at_another_sha_never_makes_a_flake", + "observability/tests/test_ci_runs.py::FlakeTests::test_the_attempts_list_never_adds_rows" + ], + "verification": "test" + }, + { + "id": "AC-005", + "statement": "Point 5, merge-queue wait: mq_wait_s is startedAt - createdAt on a run whose event is merge_group, and null on every other run; a merge_group run whose startedAt is missing yields null, never 0.", + "tests": [ + "observability/tests/test_ci_runs.py::MqWaitTests::test_a_merge_group_run_measures_the_wait_from_created_to_started", + "observability/tests/test_ci_runs.py::MqWaitTests::test_a_non_merge_group_run_has_no_queue_wait", + "observability/tests/test_ci_runs.py::MqWaitTests::test_a_merge_group_run_with_no_started_at_has_no_queue_wait" + ], + "verification": "test" + }, + { + "id": "AC-006", + "statement": "Point 6, CLI: observability/cli_ci_runs.py reads the JSON bundle {repo, run, jobs, attempts} from stdin and writes one compact JSON object per job to stdout as JSONL (trailing newline, rows identical to build_rows for the same bundle); input that is not JSON and a bundle without a run object exit 2 with an empty stdout and a message on stderr. The CLI runs with sockets and subprocess creation replaced by a raiser and with PYTHONPATH unset, proving no network call and no gh call in the tested path.", + "tests": [ + "observability/tests/test_ci_runs.py::CliTests::test_the_cli_writes_one_json_line_per_job_from_stdin", + "observability/tests/test_ci_runs.py::CliTests::test_the_cli_refuses_input_that_is_not_json", + "observability/tests/test_ci_runs.py::CliTests::test_the_cli_refuses_a_bundle_without_a_run", + "observability/tests/test_ci_runs.py::CliTests::test_the_cli_needs_no_network_and_no_subprocess" + ], + "verification": "test" + }, + { + "id": "AC-007", + "statement": "Point 7, bounded facts: every row carries exactly the merged schema's sixteen properties, no more and no fewer, and nothing else from the gh payload survives (no node ids, database ids, URL or URL-shaped field, actor, commit author or message, display title, branch, labels, runner name or steps). event is the run's event when it is one of the schema's enum values and 'other' otherwise; conclusion is the job's conclusion when it is in the enum, 'unknown' when it is not, and null while the job has not finished; pr_number is the run's positive integer prNumber or null; a repo that is not owner/name and a job name that cannot satisfy the schema are refused with ValueError. All fixtures are hand-built mock gh JSON whose identifying values are replaced with 'scrubbed', and a fixture test proves no URL, host, e-mail, node id or token marker is in them.", + "tests": [ + "observability/tests/test_ci_runs.py::RowShapeTests::test_the_row_drops_every_field_outside_the_allowlist", + "observability/tests/test_ci_runs.py::RowShapeTests::test_every_row_carries_exactly_the_schema_properties", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_run_event_outside_the_enum_is_recorded_as_other", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_conclusion_outside_the_enum_is_recorded_as_unknown", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_job_that_has_not_finished_has_a_null_conclusion", + "observability/tests/test_ci_runs.py::RowShapeTests::test_the_row_carries_the_pull_request_number", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_run_without_a_pull_request_number_has_null", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_repo_that_is_not_a_slug_is_refused", + "observability/tests/test_ci_runs.py::RowShapeTests::test_a_job_name_that_cannot_be_a_row_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-008", + "regression": true, + "statement": "Point 2, shards: parse_shard() reads a trailing ` (i/n)` marker from a job name and returns {'index': i, 'total': n}; a name without a marker, a trailing parenthetical that is not a fraction, and an index outside 1..total all return None. Because the merged schema types shard as integer|null and forbids additional properties, the row carries the shard INDEX (test (3/8) -> 3) and null when the name has no marker; the total lives only in parse_shard's result.", + "tests": [ + "observability/tests/test_ci_runs.py::MergedSchemaTests::test_the_merged_schema_types_shard_as_an_integer_and_forbids_extra_properties" + ], + "verification": "test" + }, + { + "id": "AC-009", + "regression": true, + "statement": "Point 7, bounded facts: every row carries exactly the merged schema's sixteen properties, no more and no fewer, and nothing else from the gh payload survives (no node ids, database ids, URL or URL-shaped field, actor, commit author or message, display title, branch, labels, runner name or steps). event is the run's event when it is one of the schema's enum values and 'other' otherwise; conclusion is the job's conclusion when it is in the enum, 'unknown' when it is not, and null while the job has not finished; pr_number is the run's positive integer prNumber or null; a repo that is not owner/name and a job name that cannot satisfy the schema are refused with ValueError. All fixtures are hand-built mock gh JSON whose identifying values are replaced with 'scrubbed', and a fixture test proves no URL, host, e-mail, node id or token marker is in them.", + "tests": [ + "observability/tests/test_ci_runs.py::FixtureScrubTests::test_every_fixture_is_scrubbed_of_urls_hosts_emails_and_tokens" + ], + "verification": "test" + } + ], + "assumptions": [ + "The merged schema is frozen for this slice: shard is integer|null with additionalProperties false, so a row carries the shard index and parse_shard keeps the total.", + "The gh shapes the fixtures mirror: jobs carry name, status, conclusion, createdAt, startedAt, completedAt; the run carries headSha, workflowName, attempt, event, createdAt, startedAt and an optional prNumber (the collector supplies it; gh run view does not expose a PR number itself).", + "attempts items name the sha they ran at; an attempt whose headSha is missing or different from the run's is not paired for flake.", + "A merge_group run's merge-queue wait is the run's own created->started wait; the poller-log measure in METRICS.md is out of scope here.", + "Fixtures are hand-built mocks, not recorded payloads: this slice has no network, so they pin shapes and arithmetic rather than GitHub's live behavior." + ], + "authorization": { + "human_gates": [ + "merge", + "tag", + "release", + "deploy", + "publish" + ], + "not_authorized": [ + "merge", + "tag", + "release", + "deploy", + "publish", + "restart", + "force-push", + "branch deletion", + "editing the approved tests, the fixtures or the contract", + "changing observability/schemas/ci-run.schema.json or observability/handoff/**", + "changing .github/** or adding a workflow", + "calling gh or any network endpoint from the builder, the CLI or the tests", + "committing recorded GitHub payloads (fixtures stay mock and scrubbed)" + ] + }, + "contract_version": "acdd/1", + "dependencies": [ + "observability/schemas/ci-run.schema.json and observability/examples/ci-run.json (merged in #153); this contract does not modify them", + "observability/handoff/observability-ci-runs.md (PR #160, plan-only handoff; read-only here)", + "observability/tests/test_schemas.py and observability/validate.py (the stdlib Validator the rows are checked with)" + ], + "evidence_required": [ + "red", + "green", + "review", + "security" + ], + "id": "obs-ci-runs", + "interfaces": [ + { + "change": "add", + "kind": "module", + "name": "observability.ci_runs", + "notes": "new stdlib-only module; importable as observability.ci_runs (and as ci_runs with observability/ on sys.path); no import-time I/O" + }, + { + "change": "add", + "kind": "function", + "name": "build_rows", + "notes": "build_rows(run, jobs, *, repo, attempts=()) -> list[dict]; run is the gh run document (headSha, workflowName, attempt, event, createdAt, startedAt, prNumber), jobs is the {'jobs': [...]} document or a bare list, attempts is a sequence of {attempt, headSha, jobs} used only for flake; raises ValueError for a repo that is not owner/name, a job name that cannot be a row, or a job with no timestamp" + }, + { + "change": "add", + "kind": "function", + "name": "parse_shard", + "notes": "parse_shard(job_name) -> {'index': int, 'total': int} | None; a trailing ` (i/n)` with 1 <= i <= n and n >= 2" + }, + { + "change": "add", + "kind": "function", + "name": "timestamp_delta", + "notes": "timestamp_delta(start, end) -> seconds as a number, or None when either side is missing/unparseable or end < start; RFC 3339 with Z or an offset" + }, + { + "change": "add", + "kind": "cli", + "name": "observability/cli_ci_runs.py", + "notes": "reads stdin JSON {repo, run, jobs, attempts}; writes one compact JSON object per row to stdout; exit 0 on success, exit 2 with empty stdout and a stderr message on bad JSON or a bundle without a run object; must work as `python3 observability/cli_ci_runs.py` with PYTHONPATH unset" + } + ], + "notes": [ + "RED at 8e053de14173cca6aa028c2e51e16a6f64494826 is tests-only: observability/tests/test_ci_runs.py plus nine mock gh fixtures and their README. Both assigned files are absent at RED, so 47 cited tests fail at call stage with AssertionError and 0 errors; 2 cited tests pass at RED (the merged-schema constant check and the fixture scrub check) and are split into AC-008 and AC-009 with regression: true, their statements copied verbatim from AC-002 and AC-007.", + "Shard deviation, deliberate: the parent wording asked for shard {index, total} on the row, but the merged schema types shard as integer|null and forbids additional properties, so a {index, total} object cannot validate. The row carries the index (test (3/8) -> 3) and parse_shard returns {'index': 3, 'total': 8}; the schema is not modified.", + "flake rule pinned here: only a `failure` conclusion followed by a later `success` at the same sha is a flake. timed_out, cancelled, skipped and startup_failure are not failures for this flag (a cancelled attempt then a pass is pinned false), because a cancelled job is not evidence that the job failed.", + "ts is the only row field with a fallback chain (completedAt, startedAt, createdAt, run createdAt); a row with none of them is refused instead of emitting a null ts, because ts is required and pattern-checked by the schema.", + "The cited ids are repo-relative (observability/tests/test_ci_runs.py::Class::test). pytest writes its junit classname relative to its rootdir, and this host has a stray /tmp/pyproject.toml, so a checkout under /tmp resolves rootdir=/tmp and prefixes the ids; the RED artifacts were therefore produced from a checkout of the same RED sha outside /tmp. Run the gate with the repo as pytest's rootdir.", + "Out of scope: no collector, no SQLite store, no dashboard, no METRICS.md change, no schema change, no CI change. gitleaks must run before the push (the handoff asks for it); the fixtures contain no tokens by construction.", + "Verification during RED: the whole observability tests directory is 47 failed + 88 passed at the RED head; the 88 are the pre-existing tests plus the two regression tests above, so nothing regressed." + ], + "outcome": { + "observable_behavior": [ + "build_rows(run, jobs, *, repo, attempts=()) returns one dict per job of the run, in job order, and [] for a run with no jobs", + "every returned row validates against observability/schemas/ci-run.schema.json and has exactly its sixteen properties", + "a job name ending in ` (i/n)` yields shard i in the row (null without a marker); parse_shard returns {'index': i, 'total': n} or None", + "queued_s is startedAt - createdAt and duration_s is completedAt - startedAt; a missing or unparseable timestamp, or an end before a start, is null and never 0 or negative", + "flake is true only when the same job concluded failure on an earlier attempt and success on a later attempt at the same sha; a lone failure, a first-time pass and a cancelled attempt are false", + "mq_wait_s is startedAt - createdAt for a merge_group run and null for every other event", + "the row's ts is the job completion, else the job start, else the job creation, else the run creation; a row that cannot be timestamped is refused", + "the event and conclusion fields are clamped to the schema enums ('other' / 'unknown' / null), pr_number is a positive integer or null, and repo must be owner/name", + "observability/cli_ci_runs.py turns the stdin bundle {repo, run, jobs, attempts} into JSONL on stdout with no network and no gh; bad input exits 2 with empty stdout", + "no fixture or row carries a URL, host, e-mail, node id, body or token" + ], + "summary": "The ci.run/v1 contract and example are merged but nothing builds rows from them. This slice adds the pure builder and the stdin CLI that turn `gh run view --json` and `gh run view --json jobs` output into one validated ci.run/v1 row per job, so queue time, duration, flake rate and merge-queue wait can be measured without a collector, a store or a dashboard. It reads mock payloads only: no network, no gh call, and no field beyond the allowed names (slug, workflow, job, sha, timestamps, conclusion, event, attempt, shard, flake, mq wait, PR number) leaves the builder." + }, + "review": { + "approved_at": "2026-11-29", + "approved_by": "approved: f4f46c3a (BOARD-PLAN-SYNC, full f4f46c3ac91291fe1e197f1cc7c11ddd032dd8405a5394aa7bd4833ccd1c141d, RED 727d8a34), 1412cb51 (LEDGER-WATCH, full 1412cb5156237b1b7292c1e61bdc16d9aeec785ed9fa619d9216954688bba777, RED 07dd9004), ed0fa7b5 (OBS-CI-RUNS-HANDOFF, full ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f, RED 8e053de1), 2026-11-29", + "contract_sha256": "ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f", + "status": "approved" + }, + "risk": { + "blast_radius": "nothing consumes ci.run/v1 yet, so a wrong row changes no decision today; once the store and the dashboards read these rows, a wrong shard, timing or flake would be a wrong metric rather than a wrong merge", + "reasons": [ + "new read-only builder and CLI over mock gh JSON; no collector, store, dashboard or CI wiring", + "no network and no gh call in the tested code path", + "the merged schema and the handoff doc are read-only; nothing existing changes behavior" + ], + "tier": "low" + }, + "scope": { + "assigned_files": [ + "observability/ci_runs.py", + "observability/cli_ci_runs.py" + ], + "prohibited": [ + ".github/**", + ".rizzstack/**", + "CHANGELOG.md", + "conftest.py", + "**/conftest.py", + "pyproject.toml", + "observability/schemas/**", + "observability/handoff/**", + "observability/tests/test_ci_runs.py", + "observability/tests/fixtures/**" + ], + "read_only": [ + "observability/schemas/**", + "observability/examples/ci-run.json", + "observability/handoff/**", + "observability/tests/test_schemas.py", + "observability/tests/test_metrics_records.py", + "observability/tests/test_envelope.py", + "observability/validate.py", + ".github/**" + ], + "test_files": [ + "observability/tests/test_ci_runs.py", + "observability/tests/fixtures/ci_runs/README.md", + "observability/tests/fixtures/ci_runs/attempt_1.json", + "observability/tests/fixtures/ci_runs/jobs_failed_only.json", + "observability/tests/fixtures/ci_runs/jobs_merge_group.json", + "observability/tests/fixtures/ci_runs/jobs_missing_timestamps.json", + "observability/tests/fixtures/ci_runs/jobs_pull_request.json", + "observability/tests/fixtures/ci_runs/run_failed_only.json", + "observability/tests/fixtures/ci_runs/run_merge_group.json", + "observability/tests/fixtures/ci_runs/run_missing_timestamps.json", + "observability/tests/fixtures/ci_runs/run_pull_request.json" + ] + }, + "source_rev": "8e053de14173cca6aa028c2e51e16a6f64494826", + "supersedes": [], + "tdd": { + "applicable": true + }, + "title": "ci.run/v1 rows from gh run view JSON: one row per job with shard, timings, flake and merge-queue wait from a pure builder validated against the merged schema, plus a stdin->JSONL CLI that never calls gh", + "verification": { + "commands": [ + "env -u PYTHONPATH python3 -m pytest -q -p no:cacheprovider observability/tests/test_ci_runs.py", + "env -u PYTHONPATH python3 -m pytest -q -p no:cacheprovider observability/tests", + "env -u PYTHONPATH python3 -m unittest discover -s observability/tests -t ." + ], + "independent": true, + "integration": false + } +} diff --git a/.rizzstack/leases/obs-ci-runs-handoff.json b/.rizzstack/leases/obs-ci-runs-handoff.json new file mode 100644 index 0000000..82b289b --- /dev/null +++ b/.rizzstack/leases/obs-ci-runs-handoff.json @@ -0,0 +1,62 @@ +{ + "branch": "feat/obs-ci-runs-handoff", + "contract_id": "obs-ci-runs", + "contract_sha256": "ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f", + "derived_from": { + "approved_at": "2026-11-29", + "approved_by": "approved: f4f46c3a (BOARD-PLAN-SYNC, full f4f46c3ac91291fe1e197f1cc7c11ddd032dd8405a5394aa7bd4833ccd1c141d, RED 727d8a34), 1412cb51 (LEDGER-WATCH, full 1412cb5156237b1b7292c1e61bdc16d9aeec785ed9fa619d9216954688bba777, RED 07dd9004), ed0fa7b5 (OBS-CI-RUNS-HANDOFF, full ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f, RED 8e053de1), 2026-11-29", + "contract": ".rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json" + }, + "id": "obs-ci-runs-handoff", + "lease_version": "rizzstack.lease/1", + "review": { + "approved_at": "2026-11-29", + "approved_by": "approved: f4f46c3a (BOARD-PLAN-SYNC, full f4f46c3ac91291fe1e197f1cc7c11ddd032dd8405a5394aa7bd4833ccd1c141d, RED 727d8a34), 1412cb51 (LEDGER-WATCH, full 1412cb5156237b1b7292c1e61bdc16d9aeec785ed9fa619d9216954688bba777, RED 07dd9004), ed0fa7b5 (OBS-CI-RUNS-HANDOFF, full ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f, RED 8e053de1), 2026-11-29", + "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", + "status": "frozen" + }, + "scope": { + "assigned_files": [ + "observability/ci_runs.py", + "observability/cli_ci_runs.py" + ], + "prohibited": [ + ".github/**", + ".rizzstack/**", + "CHANGELOG.md", + "conftest.py", + "**/conftest.py", + "pyproject.toml", + "observability/schemas/**", + "observability/handoff/**", + "observability/tests/test_ci_runs.py", + "observability/tests/fixtures/**" + ], + "read_only": [ + "observability/schemas/**", + "observability/examples/ci-run.json", + "observability/handoff/**", + "observability/tests/test_schemas.py", + "observability/tests/test_metrics_records.py", + "observability/tests/test_envelope.py", + "observability/validate.py", + ".github/**" + ], + "test_files": [ + "observability/tests/test_ci_runs.py", + "observability/tests/fixtures/ci_runs/README.md", + "observability/tests/fixtures/ci_runs/attempt_1.json", + "observability/tests/fixtures/ci_runs/jobs_failed_only.json", + "observability/tests/fixtures/ci_runs/jobs_merge_group.json", + "observability/tests/fixtures/ci_runs/jobs_missing_timestamps.json", + "observability/tests/fixtures/ci_runs/jobs_pull_request.json", + "observability/tests/fixtures/ci_runs/run_failed_only.json", + "observability/tests/fixtures/ci_runs/run_merge_group.json", + "observability/tests/fixtures/ci_runs/run_missing_timestamps.json", + "observability/tests/fixtures/ci_runs/run_pull_request.json" + ] + }, + "slice": "OBS-CI-RUNS-HANDOFF", + "source_rev": "8e053de14173cca6aa028c2e51e16a6f64494826", + "verify_sha": "8e053de14173cca6aa028c2e51e16a6f64494826" +} From 1889f94bea855bc22dd8e9ee2a25c3bf7fcdbf74 Mon Sep 17 00:00:00 2001 From: "rizzstack-coordinator[bot]" <362099543+rizzstack-coordinator[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2026 07:58:22 -0500 Subject: [PATCH 2/3] test(docs-parity): register lease PR 199 in EXCLUDED_PRS so the merge leaves main green --- tests/test_docs_parity.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_docs_parity.py b/tests/test_docs_parity.py index 702d0b7..5bf0336 100644 --- a/tests/test_docs_parity.py +++ b/tests/test_docs_parity.py @@ -57,6 +57,11 @@ #: exclusion states why; a merge number missing from both the registry and this #: mapping is a test failure. EXCLUDED_PRS: dict[int, str] = { + 199: ( + "lease landing: adds the approved OBS-CI-RUNS-HANDOFF contract ed0fa7b5 and its lease " + "(gate metadata only, no product or changelog surface); it carries its own " + "exclusion so merging it leaves main green" + ), 197: ( "docs-only: points the coordinator playbook and the lease-tamper gate doc at " "rizzstack's GitHub App identity guide (target coordinator/reviewer bots; gate by login " From d192eaf24970627ea2239163226842d880be0451 Mon Sep 17 00:00:00 2001 From: "rizzstack-coordinator[bot]" <362099543+rizzstack-coordinator[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2026 08:44:28 -0500 Subject: [PATCH 3/3] lease(obs-ci-runs-handoff): re-cut to approved contract feb24180 (docs-parity assigned) --- ...65606b426b562bdafae7d1da956a361c0d887f19.json} | 9 +++++---- .rizzstack/leases/obs-ci-runs-handoff.json | 15 ++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) rename .rizzstack/contracts/{ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json => feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19.json} (97%) diff --git a/.rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json b/.rizzstack/contracts/feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19.json similarity index 97% rename from .rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json rename to .rizzstack/contracts/feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19.json index 7e65398..20b7a7a 100644 --- a/.rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json +++ b/.rizzstack/contracts/feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19.json @@ -216,9 +216,9 @@ "summary": "The ci.run/v1 contract and example are merged but nothing builds rows from them. This slice adds the pure builder and the stdin CLI that turn `gh run view --json` and `gh run view --json jobs` output into one validated ci.run/v1 row per job, so queue time, duration, flake rate and merge-queue wait can be measured without a collector, a store or a dashboard. It reads mock payloads only: no network, no gh call, and no field beyond the allowed names (slug, workflow, job, sha, timestamps, conclusion, event, attempt, shard, flake, mq wait, PR number) leaves the builder." }, "review": { - "approved_at": "2026-11-29", - "approved_by": "approved: f4f46c3a (BOARD-PLAN-SYNC, full f4f46c3ac91291fe1e197f1cc7c11ddd032dd8405a5394aa7bd4833ccd1c141d, RED 727d8a34), 1412cb51 (LEDGER-WATCH, full 1412cb5156237b1b7292c1e61bdc16d9aeec785ed9fa619d9216954688bba777, RED 07dd9004), ed0fa7b5 (OBS-CI-RUNS-HANDOFF, full ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f, RED 8e053de1), 2026-11-29", - "contract_sha256": "ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f", + "approved_at": "2026-11-30", + "approved_by": "Kyle (owner) typed: approved: 2d40e1ed (LEDGER-WATCH re-cut, full 2d40e1ed8bed9157480ab764bc634582e1a1494875188d7e884df831b1d98fe8, RED 07dd9004), feb24180 (OBS-CI-RUNS-HANDOFF re-cut, full feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19, RED 8e053de1), 2026-11-30", + "contract_sha256": "feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19", "status": "approved" }, "risk": { @@ -233,7 +233,8 @@ "scope": { "assigned_files": [ "observability/ci_runs.py", - "observability/cli_ci_runs.py" + "observability/cli_ci_runs.py", + "tests/test_docs_parity.py" ], "prohibited": [ ".github/**", diff --git a/.rizzstack/leases/obs-ci-runs-handoff.json b/.rizzstack/leases/obs-ci-runs-handoff.json index 82b289b..acca04b 100644 --- a/.rizzstack/leases/obs-ci-runs-handoff.json +++ b/.rizzstack/leases/obs-ci-runs-handoff.json @@ -1,24 +1,25 @@ { "branch": "feat/obs-ci-runs-handoff", "contract_id": "obs-ci-runs", - "contract_sha256": "ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f", + "contract_sha256": "feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19", "derived_from": { - "approved_at": "2026-11-29", - "approved_by": "approved: f4f46c3a (BOARD-PLAN-SYNC, full f4f46c3ac91291fe1e197f1cc7c11ddd032dd8405a5394aa7bd4833ccd1c141d, RED 727d8a34), 1412cb51 (LEDGER-WATCH, full 1412cb5156237b1b7292c1e61bdc16d9aeec785ed9fa619d9216954688bba777, RED 07dd9004), ed0fa7b5 (OBS-CI-RUNS-HANDOFF, full ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f, RED 8e053de1), 2026-11-29", - "contract": ".rizzstack/contracts/ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f.json" + "approved_at": "2026-11-30", + "approved_by": "Kyle (owner) typed: approved: 2d40e1ed (LEDGER-WATCH re-cut, full 2d40e1ed8bed9157480ab764bc634582e1a1494875188d7e884df831b1d98fe8, RED 07dd9004), feb24180 (OBS-CI-RUNS-HANDOFF re-cut, full feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19, RED 8e053de1), 2026-11-30", + "contract": ".rizzstack/contracts/feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19.json" }, "id": "obs-ci-runs-handoff", "lease_version": "rizzstack.lease/1", "review": { - "approved_at": "2026-11-29", - "approved_by": "approved: f4f46c3a (BOARD-PLAN-SYNC, full f4f46c3ac91291fe1e197f1cc7c11ddd032dd8405a5394aa7bd4833ccd1c141d, RED 727d8a34), 1412cb51 (LEDGER-WATCH, full 1412cb5156237b1b7292c1e61bdc16d9aeec785ed9fa619d9216954688bba777, RED 07dd9004), ed0fa7b5 (OBS-CI-RUNS-HANDOFF, full ed0fa7b5ea081982025c96ef2581853f56217389abdaf2c69cbee8210f026f9f, RED 8e053de1), 2026-11-29", + "approved_at": "2026-11-30", + "approved_by": "Kyle (owner) typed: approved: 2d40e1ed (LEDGER-WATCH re-cut, full 2d40e1ed8bed9157480ab764bc634582e1a1494875188d7e884df831b1d98fe8, RED 07dd9004), feb24180 (OBS-CI-RUNS-HANDOFF re-cut, full feb24180ccda654801146efa65606b426b562bdafae7d1da956a361c0d887f19, RED 8e053de1), 2026-11-30", "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", "status": "frozen" }, "scope": { "assigned_files": [ "observability/ci_runs.py", - "observability/cli_ci_runs.py" + "observability/cli_ci_runs.py", + "tests/test_docs_parity.py" ], "prohibited": [ ".github/**",