diff --git a/.github/workflows/upstreaming-worker.lock.yml b/.github/workflows/upstreaming-worker.lock.yml index a656ff95f7d2..43bdb1f4328a 100644 --- a/.github/workflows/upstreaming-worker.lock.yml +++ b/.github/workflows/upstreaming-worker.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"30088af59ad86726a3c2b0b6b6076ec9463412481ddfd3a12da5d807b699c00a","body_hash":"19b4705095d742dc2c1c10ff72b468f2cb470e4b3a11bf80a9a4deac6ee4b7f4","compiler_version":"v1.2.2","strict":true,"agent_id":"pi","agent_model":"anthropic/claude-opus-5-5","engine_versions":{"pi":"1.5.0"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"30088af59ad86726a3c2b0b6b6076ec9463412481ddfd3a12da5d807b699c00a","body_hash":"a8abe13163eb37ad8a7dfcef0c8623d9063889694d364506d0b22cb59d14249a","compiler_version":"v1.2.2","strict":true,"agent_id":"pi","agent_model":"anthropic/claude-opus-5-5","engine_versions":{"pi":"1.5.0"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_DEFAULT_OTLP_ENDPOINT","GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","RISEPROJECT_APP_PRIVATE_KEY","RISEPROJECT_UPSTREAMING_APP_PRIVATE_KEY"],"actions":[{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/create-github-app-token","sha":"64ab729a6294000f5aa4a4bc0b73d1f32bc45510","version":"v3.3.0"},{"repo":"actions/download-artifact","sha":"9000827ccba6bdab643e8b6fd33ac0654aef8333","version":"v8.0.2"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"949feb2413d6458794dcd2491c4babbbce0c15c1","version":"v7.1.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"actions/upload-artifact","sha":"cf430e030ddbb5b0abf93d22962f4752f3646cd9","version":"v7.0.2"},{"repo":"astral-sh/setup-uv","sha":"20cfd1bf945f4377ade1205e4dbc17946fc9a30d","version":"v10.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"53d0749e19424a918acd82b4d140264ce48f2f14","version":"v1.2.2"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.29.11","digest":"sha256:8774a73c351395b41d2ad0af4ddb4689007c67de3cd08bd9f43bb8a0e300690e","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.29.11@sha256:8774a73c351395b41d2ad0af4ddb4689007c67de3cd08bd9f43bb8a0e300690e"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.11","digest":"sha256:88d2d0e315a504d93fd4fb8847fd0f6b7f4469f41a6fc6047b3dc9654c56ab2c","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.11@sha256:88d2d0e315a504d93fd4fb8847fd0f6b7f4469f41a6fc6047b3dc9654c56ab2c"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.29.11","digest":"sha256:861739ecf924dd2db5e5fb652db2ad82aaafd1615623297ddabc8f41a36b2847","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.29.11@sha256:861739ecf924dd2db5e5fb652db2ad82aaafd1615623297ddabc8f41a36b2847"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.5.6","digest":"sha256:342cd624e1f179d91be2de7a146fc4f387092e62e6c8a47506d7932e113d2311","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.5.6@sha256:342cd624e1f179d91be2de7a146fc4f387092e62e6c8a47506d7932e113d2311"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc","pinned_image":"ghcr.io/github/gh-aw-node@sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc"},{"image":"ghcr.io/github/github-mcp-server:v2.1.0","digest":"sha256:f6056fc10bfffcc8c81a6417a2e9ca12808647e8dd6049642a4feaadee0e0f8a","pinned_image":"ghcr.io/github/github-mcp-server:v2.1.0@sha256:f6056fc10bfffcc8c81a6417a2e9ca12808647e8dd6049642a4feaadee0e0f8a"}],"mcp_servers":[{"name":"github","tools":["get_commit","get_file_contents","get_latest_release","get_me","get_pull_request","get_pull_request_comments","get_pull_request_diff","get_pull_request_files","get_pull_request_review_comments","get_pull_request_reviews","get_pull_request_status","get_release_by_tag","get_tag","issue_read","list_branches","list_commits","list_issue_types","list_issues","list_pull_requests","list_releases","list_starred_repositories","list_tags","pull_request_read","search_code","search_issues","search_pull_requests","search_repositories"]},{"name":"github-authenticated","tools":["actions_list","get_commit","get_file_contents","get_pull_request","get_pull_request_comments","get_pull_request_diff","get_pull_request_files","get_pull_request_review_comments","get_pull_request_reviews","get_pull_request_status","issue_read","list_commits","list_issues","list_pull_requests","pull_request_read","search_code","search_issues","search_pull_requests"]},{"name":"safeoutputs","tools":["noop","report_incomplete","report_missing_data","report_missing_tool","upload_artifact"]},{"name":"work-queue","tools":["work_queue_claim_finish","work_queue_dispatch_next","work_queue_explain","work_queue_read","work_queue_submit"]}],"threat_detection":{"mode":"enabled"},"admission":false,"work_queue":{"worker":true,"logical_contract":"056b332b022951fc3d1ae91c58cb202ea509dcef2a5d2c296a6cc0a9f8abc00a"},"agent_metadata":{}} # This file was automatically generated by gh-aw (v1.2.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/.github/workflows/upstreaming-worker.md b/.github/workflows/upstreaming-worker.md index d9001fb6f7eb..f27214e327c7 100644 --- a/.github/workflows/upstreaming-worker.md +++ b/.github/workflows/upstreaming-worker.md @@ -319,6 +319,10 @@ change without asking the reviewer to use command syntax. The trusted publisher will admit only the exact changed paths in this repair and persist verified additions to contribution scope. This does not permit globs or unrelated files. Inline review comment paths are present in the human-relay evidence data. +For contributions whose dossier predates mandatory path coverage, +`legacy_scope_extension` is true during repair. CI evidence may then justify an +additional exact file under the same rules. This compatibility path is absent +for new, complete dossiers. ## Mandatory change-history research diff --git a/SESSIONLOG.md b/SESSIONLOG.md index 17561079778f..afed41912a69 100644 --- a/SESSIONLOG.md +++ b/SESSIONLOG.md @@ -24,3 +24,4 @@ - Addressed PR #4989 review feedback by moving the status-page generator into `upstreaming/`, invoking it through `uv run`, and adding focused rendering coverage. - Fixed review and CI reconciliation so pending human feedback survives head changes, every repair carries and acknowledges all feedback evidence, `fix_needed` cannot be overwritten before dispatch, and any executed build or test failure returns handoff to automated development repair. - Replaced the rejected workflow-glob approach with complete dossier path coverage and natural-language review scope extension: human-relay-backed repairs may add exact changed paths, which trusted publication verifies and persists without requiring command syntax. +- Added an exact-path repair compatibility flag for live contributions whose dossiers predate mandatory path coverage; new dossiers are marked coverage-complete and cannot use the legacy allowance. diff --git a/upstreaming/INTEGRATION.md b/upstreaming/INTEGRATION.md index aa1f4315bdb8..db6cbfa26544 100644 --- a/upstreaming/INTEGRATION.md +++ b/upstreaming/INTEGRATION.md @@ -197,7 +197,10 @@ later asks in ordinary natural language for a change that requires another file, the human-relay-backed repair may identify and change that additional exact path without command syntax. The trusted publisher admits only exact paths actually changed by that repair, applies all existing content and workflow -safety checks, and persists the verified paths into contribution scope. +safety checks, and persists the verified paths into contribution scope. Live +contributions whose dossiers predate mandatory path coverage receive the same +exact-path compatibility only during repair; new dossiers are marked complete +and cannot use that legacy allowance. Previously merged implementation: diff --git a/upstreaming/fork_publish.py b/upstreaming/fork_publish.py index 54cf97573df8..09cdb5105f4b 100644 --- a/upstreaming/fork_publish.py +++ b/upstreaming/fork_publish.py @@ -235,7 +235,7 @@ def publish(*, record: dict, task: dict, proposal: dict, mbox: bytes, token: str outside_scope = sorted(path for path in claimed if not any( fnmatch.fnmatchcase(path, allowed) for allowed in scope.allowed_globs)) if outside_scope: - if not task.get("review_scope_extension"): + if not (task.get("review_scope_extension") or task.get("legacy_scope_extension")): return Outcome("rejected", f"proposal changes files outside admitted scope: {outside_scope}", candidate=cand, failure_class="validation") if any(any(ch in path for ch in "*?[]") for path in outside_scope): diff --git a/upstreaming/reconcile.py b/upstreaming/reconcile.py index 70d8efaf1dd3..a41156775d49 100644 --- a/upstreaming/reconcile.py +++ b/upstreaming/reconcile.py @@ -282,6 +282,7 @@ def apply_publication(rec: dict, outcome: dict, *, now: str, policy: dict | None new["activity"] = "idle" new["admission_class"] = dossier["proposal"]["admission_class"] new["scope_paths"] = list(dossier["proposal"]["allowed_paths"]) + new["scope_coverage_complete"] = True new["pending_human_action"] = None new["revision"] += 1 staged.append(("events", lifecycle._event(rec, new, "dossier_develop", "observation", diff --git a/upstreaming/schemas/contribution.schema.json b/upstreaming/schemas/contribution.schema.json index 95dc9918c6e4..559b3b4a6650 100644 --- a/upstreaming/schemas/contribution.schema.json +++ b/upstreaming/schemas/contribution.schema.json @@ -982,6 +982,9 @@ } ] }, + "scope_coverage_complete": { + "type": "boolean" + }, "scope_paths": { "anyOf": [ { diff --git a/upstreaming/tests/test_dossier_gate.py b/upstreaming/tests/test_dossier_gate.py index 6c965e5db80d..7e8cfbb165c7 100644 --- a/upstreaming/tests/test_dossier_gate.py +++ b/upstreaming/tests/test_dossier_gate.py @@ -201,6 +201,11 @@ def test_authorized_human_relay_enables_natural_review_scope_extension(self): ordinary = work.node(request, rec, control_repo_id="7", allowed_paths=["build.yml"], context={"reason_evidence": [{"evidence_id": "ci-1", "kind": "ci"}]}) self.assertFalse(ordinary["payload"]["review_scope_extension"]) + self.assertTrue(ordinary["payload"]["legacy_scope_extension"]) + rec["scope_coverage_complete"] = True + complete = work.node(request, rec, control_repo_id="7", allowed_paths=["build.yml"], + context={"reason_evidence": [{"evidence_id": "ci-1", "kind": "ci"}]}) + self.assertFalse(complete["payload"]["legacy_scope_extension"]) def test_full_description_url_and_links_frozen_into_work(self): body = "### Additional context\n\nhttps://github.com/example/proj/pull/31488\n" + "user context\n" * 500 diff --git a/upstreaming/tests/test_observation.py b/upstreaming/tests/test_observation.py index 5dde407feedc..8a4c6e30a3c8 100644 --- a/upstreaming/tests/test_observation.py +++ b/upstreaming/tests/test_observation.py @@ -404,6 +404,7 @@ def test_investigation_outcome_auto_admits_development(self): self.assertEqual((final["phase"], final["activity"], final["revision"]), ("provisioning", "waiting_capacity", 1)) self.assertEqual(final["admission_class"], "configuration_integration") self.assertEqual(final["scope_paths"], [".github/workflows/*", "README.rst"]) + self.assertTrue(final["scope_coverage_complete"]) self.assertIsNone(final["pending_human_action"]) self.assertIsNone(final["proposal_artifact"]) self.assertEqual(len(out.report["provision_requests"]), 1) diff --git a/upstreaming/work.py b/upstreaming/work.py index aad3b8352a47..088f02069f67 100644 --- a/upstreaming/work.py +++ b/upstreaming/work.py @@ -88,6 +88,8 @@ def payload(request: dict, record: dict, *, control_repo_id: str, allowed_paths: "allowed_paths": allowed_paths, "review_scope_extension": task in ("development_repair", "upstream_revision") and any( item.get("kind") == "human_relay" for item in context.get("reason_evidence") or []), + "legacy_scope_extension": task in ("development_repair", "upstream_revision") + and record.get("scope_coverage_complete") is not True, "distributions": record.get("distributions") or [], "admission_class": record.get("admission_class"), "reason_ids": request.get("reason_ids") or [],