Adopt accepted main input while preserving P08 authored scope
This commit is contained in:
@@ -3,6 +3,7 @@ import os
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
sys.dont_write_bytecode = True
|
||||
|
||||
control = Path(os.environ['OWNER_RUNNER_CONTROL']).resolve()
|
||||
sys.path.insert(0, str(control))
|
||||
@@ -320,5 +321,14 @@ def verify_exact_runtime_support(self, task_id, wt, sha, kind):
|
||||
return _runtime_support_verify(self, task_id, wt, sha, kind)
|
||||
Runner.verify = verify_exact_runtime_support
|
||||
|
||||
if os.environ.get("OWNER_P08_ACCEPTED_INPUT_SCOPE") == "7297a4c":
|
||||
import importlib.util
|
||||
import runner.core as accepted_scope_core
|
||||
adapter = Path("/Users/korizatou114/Projects/とりにく工房ゲーム制作部/docs/plans/original-completion-2026-10-02/execution/p08-03/accepted_input_scope.py")
|
||||
spec = importlib.util.spec_from_file_location("owner_accepted_input_scope", adapter)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
module.install(accepted_scope_core)
|
||||
|
||||
from runner.cli import main
|
||||
main()
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"project": "the-tree-p08-03-code",
|
||||
"task": "P08-03",
|
||||
"boundary": "127f22fa1e4a74cf475b40399ec54e30a5732509",
|
||||
"accepted_input_commit": "7297a4c050f0293df331c2c51bb32def248bcb6b",
|
||||
"prior_submitted": "47750010b8694c72737f47078f925b2b2e22ce59",
|
||||
"original_base": "12430ba89970bda349781e51157e72e48a4ac06f",
|
||||
"contract_sha256": "f154d94fef21bd15497f94ac418b2ba5c504afb458fa616ffd13220e806d21e3",
|
||||
"baseline_sha256": "5937be7670a3e8334c41d634f910c8187f57fbbc80827e8f2e8ab808d4428cbe",
|
||||
"spec_sha256": "7941da4edbd3c43a636a4a3d834d57c095b56da988fa3a056e55b22d3a5d50e9",
|
||||
"support_integration": "dbf5cb8f1bec88b259d010d8f3ce0486b1cfeaa3",
|
||||
"support_trace": "/Users/korizatou114/Library/Application Support/agent-control/the-tree-p08-runtime-preview/traceability/P08-03-RTPREVIEW.json",
|
||||
"conflicts": [],
|
||||
"inherited_noneditable_paths": [
|
||||
"autoload/simulation_runtime.gd",
|
||||
"docs/plans/original-completion-2026-10-02/IMPLEMENTATION_PLAN.md",
|
||||
"docs/plans/original-completion-2026-10-02/execution/mana-proposal-continuation-r03/ADOPTION_DECISION_READINESS.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/owner_model_cli.py",
|
||||
"docs/plans/original-completion-2026-10-02/execution/p18_review_context.py",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/ALL_ARCHIVE_INTEGRITY_CHECK.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/CACHE_RETIREMENT.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/CLOSED_P08_CACHE_NONCACHE_CHECK.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/CONCURRENT_APPSTORE_DOWNLOAD.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/FINAL_CAPACITY_RESULT.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/INITIAL_ARTIFACT_INVENTORY.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/OTHER_STAGE_RETIREMENT.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/README.md",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/RECREATABLE_APP_CACHE_CLEANUP.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/RESTORATION_CHECK.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/STAGE_RETIREMENT.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/STORAGE_ANALYSIS.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/XCODE_DERIVED_CACHE_CLEANUP.json",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/restore_stage.py",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/retire_other_stages.py",
|
||||
"docs/plans/original-completion-2026-10-02/execution/storage-20261014/retire_p23_stages.py",
|
||||
"docs/plans/original-completion-2026-10-02/plan_validation.json",
|
||||
"docs/plans/original-completion-2026-10-02/progress_snapshot.json",
|
||||
"docs/plans/original-completion-2026-10-02/work_packages.json",
|
||||
"docs/spec/acceptance/P08-03-RTPREVIEW.json",
|
||||
"tests/transport/test_runtime_build_preview.gd",
|
||||
"tests/transport/test_runtime_build_preview.gd.uid"
|
||||
],
|
||||
"original_units_added": 0
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"controls": {
|
||||
"real_inherited_boundary": {
|
||||
"passed": true,
|
||||
"editable_paths_added": 0
|
||||
},
|
||||
"allowed_UI": {
|
||||
"passed": true,
|
||||
"paths": [
|
||||
"scenes/main/main.gd"
|
||||
]
|
||||
},
|
||||
"runtime_edit": {
|
||||
"rejected": true,
|
||||
"reason": "scope_violation: autoload/simulation_runtime.gd"
|
||||
},
|
||||
"spec_edit": {
|
||||
"rejected": true,
|
||||
"reason": "scope_violation: docs/spec/acceptance/P08-03.json"
|
||||
},
|
||||
"secret_edit": {
|
||||
"rejected": true,
|
||||
"reason": "scope_violation: .env"
|
||||
},
|
||||
"inherited_runtime_drift": {
|
||||
"rejected": true,
|
||||
"reason": "noneditable accepted input changed: autoload/simulation_runtime.gd"
|
||||
}
|
||||
},
|
||||
"synthetic_denial_inputs": true,
|
||||
"source_files_modified": 0,
|
||||
"contract_unchanged": true
|
||||
}
|
||||
+3
-2
@@ -18,7 +18,7 @@
|
||||
"denominator_units": 88,
|
||||
"completed_delta": 0,
|
||||
"formal_validator": "7e2368f5 only historical after changed Main/checker; current 4775001 not accepted",
|
||||
"next_action": "Reuse completed dbf5cb8 shared Runtime in existing P08-03 task; preserve contract/spec and restrict next worker to UI/checker/fixture/marker scope",
|
||||
"next_action": "actual Opus repair18 direction pending; accepted inheritance audit passed; no wider worker source scope",
|
||||
"semantic_triage": "OPUS_PRE_FULL_SEMANTIC_TRIAGE_7E2368F5.json (read-only, no acceptance)",
|
||||
"capacity": "cleanup complete: 7.94GB free; 580 closed stages archived losslessly; current R09 retained; no cleanup permission pending",
|
||||
"implemented_not_accepted": [
|
||||
@@ -39,5 +39,6 @@
|
||||
"next": "accepted-main dependency adoption and existing P08 UI connection",
|
||||
"review": "INDEPENDENT_RUNTIME_SUPPORT_REVIEW_12F04D6.json",
|
||||
"integration": "dbf5cb8f1bec88b259d010d8f3ce0486b1cfeaa3"
|
||||
}
|
||||
},
|
||||
"accepted_input_commit": "7297a4c050f0293df331c2c51bb32def248bcb6b"
|
||||
}
|
||||
|
||||
+7
File diff suppressed because one or more lines are too long
@@ -0,0 +1,103 @@
|
||||
"""Audit inherited accepted input without broadening P08's editable scope."""
|
||||
import hashlib
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
RECORD = Path(__file__).with_name('ACCEPTED_DEPENDENCY_INPUT.json')
|
||||
|
||||
|
||||
def raw_git(repo, *args):
|
||||
return subprocess.check_output(['git', '-C', str(repo), *args])
|
||||
|
||||
|
||||
def names(repo, *args):
|
||||
return [s.decode('utf-8') for s in raw_git(repo, *args).split(b'\0') if s]
|
||||
|
||||
|
||||
def record_for(runner, task_id):
|
||||
record = json.loads(RECORD.read_text())
|
||||
assert runner.config['project'] == record['project'] and task_id == record['task']
|
||||
task = runner.task(task_id)
|
||||
contract = json.loads(task['contract'])
|
||||
assert hashlib.sha256(task['contract'].encode()).hexdigest() == record['contract_sha256']
|
||||
assert hashlib.sha256((runner.root / 'acceptance_baseline.json').read_bytes()).hexdigest() == record['baseline_sha256']
|
||||
assert contract['base_commit'] == record['original_base']
|
||||
trace = json.loads(Path(record['support_trace']).read_text())
|
||||
assert trace['integration_commit'] == record['support_integration']
|
||||
assert any(e['kind'] == 'final' and e['passed'] == 1 for e in trace['evidence'])
|
||||
return record, contract
|
||||
|
||||
|
||||
def audit(runner, task_id, wt, commit=None, allow_empty=False):
|
||||
from runner.core import allowed, secret_path, git, require
|
||||
record, contract = record_for(runner, task_id)
|
||||
wt = Path(wt)
|
||||
revision = commit or git(wt, 'rev-parse', 'HEAD')
|
||||
git(wt, 'merge-base', '--is-ancestor', record['accepted_input_commit'], revision)
|
||||
git(wt, 'merge-base', '--is-ancestor', record['boundary'], record['accepted_input_commit'])
|
||||
inherited = names(wt, 'diff', '--name-only', '-z', '--no-renames', record['original_base'], revision)
|
||||
for path in inherited:
|
||||
require(not secret_path(path), 'inherited secret path denied: ' + path)
|
||||
entry = raw_git(wt, 'ls-tree', revision, '--', path)
|
||||
require(not entry.startswith(b'120000 '), 'inherited symlink denied: ' + path)
|
||||
if not allowed(path, contract['allowed_paths']):
|
||||
require(entry == raw_git(wt, 'ls-tree', record['boundary'], '--', path),
|
||||
'noneditable accepted input changed: ' + path)
|
||||
spec = git(wt, 'show', revision + ':' + contract['spec_ref'].split('#')[0])
|
||||
require(hashlib.sha256(spec.encode()).hexdigest() == contract['spec_sha256'], 'original spec pin changed')
|
||||
args = ['diff', '--name-only', '-z', '--no-renames', record['accepted_input_commit']]
|
||||
if commit:
|
||||
args.append(commit)
|
||||
changed = names(wt, *args)
|
||||
if not commit:
|
||||
changed += names(wt, 'ls-files', '--others', '--exclude-standard', '-z')
|
||||
require(changed or allow_empty, 'no authored change after accepted input')
|
||||
for path in changed:
|
||||
require(allowed(path, contract['allowed_paths']) and not secret_path(path), 'scope_violation: ' + path)
|
||||
require(not (wt / path).is_symlink(), 'scope_violation: symlink ' + path)
|
||||
return sorted(set(changed))
|
||||
|
||||
|
||||
def install(core):
|
||||
original_scope = core.Runner.check_scope
|
||||
original_submit = core.Runner.submit
|
||||
|
||||
def selected(runner, task):
|
||||
return runner.config['project'] == 'the-tree-p08-03-code' and task == 'P08-03' and RECORD.exists()
|
||||
|
||||
def scope(runner, task_id, wt, commit=None):
|
||||
if selected(runner, task_id):
|
||||
return audit(runner, task_id, wt, commit)
|
||||
return original_scope(runner, task_id, wt, commit)
|
||||
|
||||
def submit(runner, task_id):
|
||||
if not selected(runner, task_id):
|
||||
return original_submit(runner, task_id)
|
||||
record, contract = record_for(runner, task_id)
|
||||
task = runner.task(task_id)
|
||||
if task['submitted'] != record['prior_submitted']:
|
||||
return original_submit(runner, task_id)
|
||||
head = core.git(Path(task['worktree']), 'rev-parse', 'HEAD')
|
||||
core.require(head == record['accepted_input_commit'], 'unrecorded worker commit')
|
||||
audit(runner, task_id, Path(task['worktree']))
|
||||
actual_task = runner.task
|
||||
|
||||
def input_task(tid):
|
||||
value = dict(actual_task(tid))
|
||||
if tid == task_id:
|
||||
value['submitted'] = record['accepted_input_commit']
|
||||
return value
|
||||
|
||||
runner.task = input_task
|
||||
try:
|
||||
result = original_submit(runner, task_id)
|
||||
finally:
|
||||
runner.task = actual_task
|
||||
runner.event(task_id, 'accepted_input_submission', dict(
|
||||
prior_submitted=record['prior_submitted'], accepted_input=record['accepted_input_commit'],
|
||||
original_contract_unchanged=True, editable_paths_added=0))
|
||||
return result
|
||||
|
||||
core.Runner.check_scope = scope
|
||||
core.Runner.submit = submit
|
||||
Reference in New Issue
Block a user