Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
42f9386
R06: accept equivalent split witness passage input
Oleksii-debug Sep 29, 2026
5c46f72
R06: align missing witness regression with split passage semantics
Oleksii-debug Sep 29, 2026
eaeedfd
R06: reconverge parallel-witness input equivalence onto canonical pac…
Oleksii-debug Sep 29, 2026
ace847e
R06: reconverge parallel-witness input repair after DEV02 queue fix
Oleksii-debug Sep 29, 2026
6856370
R06: reconverge parallel-witness input repair after WEBU queue fix
Oleksii-debug Sep 29, 2026
716b9e4
R06: requalify parallel-witness input repair on literal-head gate aut…
Oleksii-debug Sep 29, 2026
2777d8c
Fix durable constructor task-template creation
Oleksii-debug Sep 29, 2026
8b35f93
R06: lock extra parallel witness rejection
Oleksii-debug Sep 29, 2026
9572c51
Add restart regression for constructor task templates
Oleksii-debug Sep 29, 2026
77fa555
Cover constructor template persistence through app restart
Oleksii-debug Sep 29, 2026
9bcaa4b
Run constructor template restart regressions in qualification
Oleksii-debug Sep 29, 2026
ac98de1
Reconverge constructor persistence repair onto current package
Oleksii-debug Sep 29, 2026
604fb4c
Make constructor canonical forks restart-atomic
Oleksii-debug Sep 29, 2026
25176d6
Add crash-boundary regression for constructor forks
Oleksii-debug Sep 29, 2026
7a22c7f
Qualify restart-atomic constructor forks
Oleksii-debug Sep 29, 2026
0007d0b
Preserve fork update timestamp semantics
Oleksii-debug Sep 29, 2026
c36b688
Lock constructor fork timestamp compatibility
Oleksii-debug Sep 29, 2026
7d3c819
R06: bind QA67 to exact PR head and coalesce stale runs
Oleksii-debug Sep 29, 2026
6893892
Bind runtime checkpoint save to canonical current node
Oleksii-debug Sep 29, 2026
651083c
Project checkpoint identity only from runtime save truth
Oleksii-debug Sep 29, 2026
d232d2c
Lock runtime-owned checkpoint save projection
Oleksii-debug Sep 29, 2026
8c5a8e6
Prove checkpoint save cannot spoof runtime authority
Oleksii-debug Sep 29, 2026
8e01ae8
Preserve runtime save semantics before task load
Oleksii-debug Sep 29, 2026
5fa235d
Cover runtime checkpoint save before task load
Oleksii-debug Sep 29, 2026
01790ea
fix: fail closed on invalid runtime checkpoint identity
Oleksii-debug Sep 29, 2026
700bc8d
test: reject unknown runtime checkpoint nodes
Oleksii-debug Sep 29, 2026
f32207b
fix: require runtime checkpoint persistence acknowledgements
Oleksii-debug Sep 29, 2026
ed9f0b5
test: fail closed on unacknowledged checkpoint persistence
Oleksii-debug Sep 29, 2026
4a1202e
Merge PR #265: persist constructor task templates across restart
Oleksii-debug Sep 29, 2026
d20910f
fix: validate runtime checkpoint response contracts
Oleksii-debug Sep 29, 2026
5d47114
test: enforce checkpoint response contract at adapter
Oleksii-debug Sep 29, 2026
bcf0e26
merge: reconverge checkpoint runtime authority on current packaged head
Oleksii-debug Sep 29, 2026
7b2ff7a
Merge PR #267: bind checkpoint persistence to runtime truth
Oleksii-debug Sep 29, 2026
d3fc984
merge: reconverge QA67 exact-head qualification on current package
Oleksii-debug Sep 29, 2026
a458c7c
Merge PR #266: make QA67 exact-head and coalesce stale runs
Oleksii-debug Sep 29, 2026
4717d82
merge: reconverge split-witness input repair on current package
Oleksii-debug Sep 29, 2026
bfb1097
Merge PR #258: accept equivalent split parallel-witness passage input
Oleksii-debug Sep 29, 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
15 changes: 15 additions & 0 deletions .github/workflows/qa67-runtime-gradeability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,27 @@ on:
- 'lanes/dev1/repair_overlay/tests/test_constructor_runtime_gradeability.py'
- '.github/workflows/qa67-runtime-gradeability.yml'

permissions:
contents: read

env:
EXPECTED_HEAD: ${{ github.event.pull_request.head.sha || github.sha }}

concurrency:
group: qa67-constructor-runtime-${{ github.ref }}
cancel-in-progress: true

jobs:
constructor-runtime-contract:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.EXPECTED_HEAD }}
- name: Confirm exact source checkout
shell: bash
run: test "$(git rev-parse HEAD)" = "$EXPECTED_HEAD"
- uses: actions/setup-python@v5
with:
python-version: '3.13'
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/r06-constructor-v2-direct-qualification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'lanes/dev1/repair_overlay/scripture_archive_platform/authoring/**'
- 'lanes/dev1/repair_overlay/scripture_archive_platform/transport/contracts.py'
- 'lanes/dev1/repair_overlay/tests/test_authoring_transport.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_fork_recovery.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_template_persistence.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_template_transport_restart.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_v2_frontend.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_v2_lifecycle.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_v2_recovery_atomicity.py'
Expand Down Expand Up @@ -111,9 +114,18 @@ jobs:
r06_platform/scripture_archive_platform/authoring
r06_platform/scripture_archive_platform/application/service.py
r06_platform/scripture_archive_platform/transport/contracts.py
r06_platform/tests/test_constructor_fork_recovery.py
r06_platform/tests/test_constructor_template_persistence.py
r06_platform/tests/test_constructor_template_transport_restart.py
r06_platform/tests/test_constructor_v2_lifecycle.py
r06_platform/tests/test_constructor_v2_recovery_atomicity.py
r06_platform/tests/test_authoring_transport.py
- name: Run Constructor fork crash-recovery regression
run: python r06_platform/tests/test_constructor_fork_recovery.py
- name: Run Constructor template persistence regression
run: python r06_platform/tests/test_constructor_template_persistence.py
- name: Run Constructor transport restart regression
run: python r06_platform/tests/test_constructor_template_transport_restart.py
- name: Run Constructor V2 lifecycle regression
run: python r06_platform/tests/test_constructor_v2_lifecycle.py
- name: Run Constructor V2 crash-recovery regression
Expand Down
2 changes: 1 addition & 1 deletion lanes/dev1/repair_overlay/frontend/renderers-base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ def invoke(self, command: str, payload: Mapping[str, Any] | None = None, *, requ
with self._runtime_lock:
if command == "player.next":
self._validate_next_context(request_id)
response = self.adapter.invoke_runtime(self._request(command, payload or {}, request_id))
return dict(response)
response = dict(self.adapter.invoke_runtime(self._request(command, payload or {}, request_id)))
if command == "player.save_checkpoint" and self._current_node_getter is not None:
# Runtime save deliberately accepts no caller checkpoint payload.
# Capture the canonical node under the same lock as persistence so
# the platform cannot label caller-supplied metadata as D5 truth.
response["current_node_id"] = self._current_node_getter()
return response

def get_daily_case(self) -> dict[str, Any]:
"""Project Daily Case from one atomic snapshot of canonical runtime state."""
Expand Down Expand Up @@ -348,4 +353,4 @@ def build_runtime_gateway(repo_root: Path, platform_store_root: Path) -> Runtime
runtime_application=runtime,
loader=loader,
subject_catalog=evidence_bundle.subject_catalog,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,35 @@ def _daily_case(self):
def _chronology_lab(self):
if not self.player_gateway:raise ValueError('Chronology Lab requires canonical runtime')
return self.player_gateway.get_chronology_lab()
def _checkpoint_from_runtime_node(self,nid):
if nid is None:return None
if not isinstance(nid,str) or not nid:raise ValueError('runtime checkpoint exposed invalid current_node_id')
try: mission=self.loader.mission_for_node(nid)
except (KeyError,ContentLoadError) as exc: raise ValueError('runtime checkpoint references unknown canonical node') from exc
campaign_id=mission.get('campaign_id'); mission_id=mission.get('mission_id')
if not isinstance(campaign_id,str) or not campaign_id or not isinstance(mission_id,str) or not mission_id:
raise ValueError('runtime checkpoint canonical mission metadata is invalid')
return {'campaign_id':campaign_id,'mission_id':mission_id,'node_id':nid,'checkpoint_schema':'scripture.player.checkpoint.v1'}
@staticmethod
def _require_runtime_checkpoint_ack(response,operation):
expected='saved' if operation=='save' else 'restored'
if response.get(expected) is not True:
raise ValueError(f'runtime checkpoint {operation} was not acknowledged')
if operation=='restore':
schema_version=response.get('schema_version')
if isinstance(schema_version,bool) or not isinstance(schema_version,int) or schema_version < 1:
raise ValueError('runtime checkpoint restore exposed invalid schema_version')
def _save_checkpoint(self,p):
if self.player_gateway:
rr=self.player_gateway.invoke('player.save_checkpoint',{},request_id='save-player')
self._require_runtime_checkpoint_ack(rr,'save')
return {'checkpoint':self._checkpoint_from_runtime_node(rr.get('current_node_id')),'truth_owner':'D5/runtime'}
checkpoint={'campaign_id':p.get('campaign_id'),'mission_id':p.get('mission_id'),'node_id':p.get('node_id'),'saved_at':int(time.time()),'checkpoint_schema':'scripture.player.checkpoint.v1'}
if self.player_gateway:self.player_gateway.invoke('player.save_checkpoint',{},request_id='save-'+str(p.get('node_id') or 'current'))
self.store.put_json('player','checkpoint',checkpoint);return {'checkpoint':checkpoint,'truth_owner':'D5/runtime' if self.player_gateway else 'REFERENCE_TEST_ONLY'}
self.store.put_json('player','checkpoint',checkpoint);return {'checkpoint':checkpoint,'truth_owner':'REFERENCE_TEST_ONLY'}
def _restore_checkpoint(self):
if self.player_gateway:
rr=self.player_gateway.invoke('player.restore_checkpoint',{},request_id='restore-player'); nid=rr.get('current_node_id'); checkpoint=None
if nid:
try: mission=self.loader.mission_for_node(str(nid));checkpoint={'campaign_id':mission.get('campaign_id'),'mission_id':mission.get('mission_id'),'node_id':str(nid),'checkpoint_schema':'scripture.player.checkpoint.v1'}
except Exception:checkpoint={'node_id':str(nid),'checkpoint_schema':'scripture.player.checkpoint.v1'}
rr=self.player_gateway.invoke('player.restore_checkpoint',{},request_id='restore-player')
self._require_runtime_checkpoint_ack(rr,'restore'); checkpoint=self._checkpoint_from_runtime_node(rr.get('current_node_id'))
return {'checkpoint':checkpoint,'runtime_schema_version':rr.get('schema_version'),'truth_owner':'D5/runtime'}
return {'checkpoint':self.store.get_json('player','checkpoint'),'truth_owner':'REFERENCE_TEST_ONLY'}
def _progress(self,nid):
Expand All @@ -253,4 +272,4 @@ def build_default_application(repo_root:Path|None=None,store_root:Path|None=None
if runtime_application.exists():
from scripture_archive_platform.application.runtime_gateway import build_runtime_gateway
gateway=build_runtime_gateway(repo_root,effective_store.root); return PlatformApplication(repo_root,store=effective_store,player_gateway=gateway)
return PlatformApplication(repo_root,store=effective_store)
return PlatformApplication(repo_root,store=effective_store)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
SNAPSHOT_SCHEMA,
AuthoringService,
)
from .validation import identity


TRANSACTION_SCHEMA = "scripture.authoring-transaction.v1"
Expand Down Expand Up @@ -68,6 +69,43 @@ def save_draft(self, draft: Any) -> dict[str, Any]:
self._commit_mutation(out["draft_id"], out, history=history)
return copy.deepcopy(out)

def fork_record(self, kind: str, record: dict[str, Any], title: str | None = None) -> dict[str, Any]:
"""Create a canonical fork without first exposing a durable blank draft.

Preserve the historical observable fork shape (revision 2 plus an undo
entry for the initial blank draft), but publish draft + history through
the recoverable write-ahead transaction as one restart-safe mutation.
"""
kind = self._kind(kind)
if not isinstance(record, dict):
raise ValueError("record must be an object")
stable_id = identity(kind, record)
blank = self._new_draft_record(title or stable_id or f"Edit {kind}", kind)
now = int(self.clock())
out = copy.deepcopy(blank)
out[kind] = self._json_copy(record)
out.update({
"status": "DRAFT",
"created_at": int(blank.get("created_at", now)),
"updated_at": now,
"revision": 2,
"base_identity": {kind: stable_id},
})
out.setdefault("change_record", []).append({
"timestamp": now,
"action": "save_draft",
"revision": 2,
})
self._protect_identity(out)
history = {
"schema": HISTORY_SCHEMA,
"draft_id": out["draft_id"],
"undo": [self._json_copy(blank)],
"redo": [],
}
self._commit_mutation(out["draft_id"], out, history=history)
return copy.deepcopy(out)

def restore_snapshot(self, draft_id: str, snapshot_id: str) -> dict[str, Any]:
current = self.load_draft(draft_id)
snapshot = self._load_snapshot(draft_id, snapshot_id)
Expand Down
Loading
Loading