Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ebfe2ed
R06 constructor v2: persist history snapshots and safe versions
Oleksii-debug Sep 12, 2026
1fb9157
R06 constructor v2: allowlist history and version operations
Oleksii-debug Sep 12, 2026
f0c3859
R06 constructor v2: expose persisted lifecycle through app bridge
Oleksii-debug Sep 12, 2026
caec523
R06 constructor v2: prove restart history snapshots and safe rollback
Oleksii-debug Sep 12, 2026
46cf8a5
R06 constructor v2: cover allowlisted lifecycle bridge
Oleksii-debug Sep 12, 2026
aaa4315
R06 constructor v2: add keyboard semantic lifecycle surface
Oleksii-debug Sep 12, 2026
7c7d187
R06 constructor v2: mount supplemental lifecycle UI
Oleksii-debug Sep 12, 2026
4b12806
R06 constructor v2: qualify supplemental frontend module
Oleksii-debug Sep 12, 2026
3796e56
R06: make Constructor V2 mutations restart-recoverable
Oleksii-debug Sep 12, 2026
96e8a30
R06: wire packaged Constructor to recoverable authoring service
Oleksii-debug Sep 12, 2026
d386e5c
R06: fault-inject Constructor V2 recovery boundaries
Oleksii-debug Sep 12, 2026
23e00b2
R06: run Constructor lifecycle tests through recoverable service
Oleksii-debug Sep 12, 2026
f577536
R06: trigger exact-head Constructor recovery qualification
Oleksii-debug Sep 12, 2026
9fbda93
Merge current packaged head into Constructor V2 recovery candidate
Oleksii-debug Sep 12, 2026
e6ea8cb
Reconverge Constructor V2 onto current packaged head
Oleksii-debug Sep 13, 2026
0f511bf
test: cover all Constructor V2 recovery write boundaries
Oleksii-debug Sep 13, 2026
784402f
ci: qualify Constructor V2 directly across OSes
Oleksii-debug Sep 13, 2026
3c43790
converge: preserve Review Training with Constructor V2 service
Oleksii-debug Sep 13, 2026
aa092b2
converge: union Review Training and Constructor V2 transport
Oleksii-debug Sep 13, 2026
0df7012
Converge Constructor V2 onto current packaged Review Training
Oleksii-debug Sep 13, 2026
e896eee
ci: compose exact-head DEV1 substrate for Constructor V2 tests
Oleksii-debug Sep 13, 2026
f322015
Rebind Constructor V2 to packaged OTNT relation head
Oleksii-debug Sep 13, 2026
50b916a
ci: isolate verified Constructor dependency substrate
Oleksii-debug Sep 13, 2026
7e70450
ci: include verified Constructor transport fixture dependency
Oleksii-debug Sep 13, 2026
a4c0047
Reconverge Constructor V2 onto post-speech canonical package
Oleksii-debug Sep 13, 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
129 changes: 129 additions & 0 deletions .github/workflows/r06-constructor-v2-direct-qualification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: R06 Constructor V2 Direct Qualification

on:
pull_request:
paths:
- 'lanes/dev1/repair_overlay/frontend/constructor-v2-ui.js'
- 'lanes/dev1/repair_overlay/frontend/transport.js'
- 'lanes/dev1/repair_overlay/scripture_archive_platform/application/service.py'
- '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_v2_frontend.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_v2_lifecycle.py'
- 'lanes/dev1/repair_overlay/tests/test_constructor_v2_recovery_atomicity.py'
- '.github/workflows/r06-constructor-v2-direct-qualification.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: r06-constructor-v2-direct-${{ github.ref }}
cancel-in-progress: true

jobs:
constructor-v2-direct-overlay:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
pathsep: ':'
- os: windows-latest
pathsep: ';'
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
EXPECTED_HEAD: ${{ github.event.pull_request.head.sha || github.sha }}
PYTHONPATH: "${{ github.workspace }}/r06_platform${{ matrix.pathsep }}${{ github.workspace }}"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.EXPECTED_HEAD }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Confirm exact source checkout
shell: bash
run: test "$(git rev-parse HEAD)" = "$EXPECTED_HEAD"
- name: Reconstruct verified Constructor dependency substrate and apply overlay
shell: bash
run: |
python - <<'PY'
import base64, hashlib, shutil, zipfile
from pathlib import Path, PurePosixPath

parts = sorted(Path('lanes/dev1/source_parts').glob('part-*.b64'))
if not parts:
raise SystemExit('missing DEV1 source parts')
encoded = ''.join(path.read_text(encoding='ascii') for path in parts)
archive_bytes = base64.b64decode(encoded)
archive = Path('DEV1_R06_PLATFORM_SOURCE_CONSTRUCTOR_SUBSTRATE.zip')
archive.write_bytes(archive_bytes)
print('exact-head source-parts sha256=', hashlib.sha256(archive_bytes).hexdigest())

# Shared DEV1 release qualification owns whole-archive fidelity (#146).
# Constructor qualification needs the Python platform dependency subtree
# plus the canonical test fixture used by the transport regression.
# CRC-verify every extracted dependency and fail closed on corruption in
# those dependencies; unrelated corrupt members are not evidence for or
# against this bounded Constructor qualification and remain #146-owned.
platform_prefix = PurePosixPath('r06_platform/scripture_archive_platform')
exact_dependencies = {PurePosixPath('r06_platform/tests/_fixture.py')}
extracted = 0
with zipfile.ZipFile(archive) as zf:
for info in zf.infolist():
member = PurePosixPath(info.filename)
wanted = (
member == platform_prefix
or platform_prefix in member.parents
or member in exact_dependencies
)
if not wanted:
continue
try:
zf.extract(info, '.')
except (zipfile.BadZipFile, OSError) as exc:
raise SystemExit(f'corrupt Constructor dependency member {info.filename}: {exc}') from exc
extracted += 1
if extracted == 0:
raise SystemExit('DEV1 source parts contain no Constructor dependency subtree')

root = Path('r06_platform')
required = [
root / 'scripture_archive_platform' / 'persistence' / 'store.py',
root / 'scripture_archive_platform' / 'content' / 'loader.py',
root / 'scripture_archive_platform' / 'domain' / 'registries.py',
root / 'tests' / '_fixture.py',
]
missing = [str(path) for path in required if not path.is_file()]
if missing:
raise SystemExit('Constructor dependency substrate missing: ' + ', '.join(missing))
shutil.copytree('lanes/dev1/repair_overlay', root, dirs_exist_ok=True)
PY
- name: Compile composed Constructor V2 surface
run: >-
python -m compileall -q
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_v2_lifecycle.py
r06_platform/tests/test_constructor_v2_recovery_atomicity.py
r06_platform/tests/test_authoring_transport.py
- name: Run Constructor V2 lifecycle regression
run: python r06_platform/tests/test_constructor_v2_lifecycle.py
- name: Run Constructor V2 crash-recovery regression
run: python r06_platform/tests/test_constructor_v2_recovery_atomicity.py
- name: Run Constructor V2 allowlist and source-isolation regression
run: python r06_platform/tests/test_authoring_transport.py
- name: Run Constructor V2 semantic frontend regression
run: python r06_platform/tests/test_constructor_v2_frontend.py
- name: Verify Constructor V2 frontend module syntax
run: node --check r06_platform/frontend/constructor-v2-ui.js
- name: Diff hygiene
shell: bash
run: git diff --check
86 changes: 86 additions & 0 deletions lanes/dev1/repair_overlay/frontend/constructor-v2-ui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import {chooseTransport,unwrap} from './transport.js';

const $=id=>document.getElementById(id);
let transport=null,mounted=false;

async function api(command,payload={}){return await unwrap(transport,command,payload)}
function announce(text){const host=$('global-status');if(host){host.textContent='';requestAnimationFrame(()=>host.textContent=text)}}
function currentDraftId(){const value=$('draft-id')?.value?.trim();if(!value)throw new Error('Спочатку відкрийте збережену чернетку.');return value}
function makeButton(label,handler){const button=document.createElement('button');button.type='button';button.textContent=label;button.onclick=handler;return button}
function text(tag,value){const el=document.createElement(tag);el.textContent=value;return el}
function syncDraftList(){const nav=$('nav-authoring');if(nav)nav.click()}

async function refreshHistory(){
const output=$('constructor-v2-output');
if(!output)return;
output.replaceChildren();
let draftId;
try{draftId=currentDraftId()}catch(error){output.append(text('p',error.message));return}
try{
const history=await api('authoring.history',{draft_id:draftId});
output.append(text('p',`Revision ${history.revision}. Undo: ${history.can_undo?'так':'ні'}. Redo: ${history.can_redo?'так':'ні'}.`));
const changes=text('h4','Історія змін');output.append(changes);
const changeList=document.createElement('ol');
(history.change_record||[]).slice(-20).forEach(row=>changeList.append(text('li',`${row.action||'change'} · revision ${row.revision??'—'} · ${row.timestamp??'—'}`)));
if(!changeList.children.length)changeList.append(text('li','Записів змін ще немає.'));
output.append(changeList);

output.append(text('h4','Snapshots'));
const snapshots=document.createElement('ul');
for(const row of history.snapshots||[]){
const li=document.createElement('li');
li.append(document.createTextNode(`${row.label||row.snapshot_id} · revision ${row.draft_revision??'—'} `));
li.append(makeButton('Diff до поточної',async()=>{
try{const diff=await api('authoring.diff_draft',{draft_id:draftId,from_snapshot_id:row.snapshot_id});announce(diff.changed?`Змінено шляхів: ${diff.changed_paths.length}`:'Відмінностей немає');const pre=document.createElement('pre');pre.textContent=(diff.changed_paths||[]).join('\n')||'No changes';li.append(pre)}catch(error){announce(`Constructor: ${error.message}`)}
}));
li.append(makeButton('Відновити snapshot',async()=>{
try{await api('authoring.restore_snapshot',{draft_id:draftId,snapshot_id:row.snapshot_id});announce('Snapshot відновлено як нову revision; попередній стан збережено safety snapshot. Перевідкрийте чернетку.');syncDraftList();await refreshHistory()}catch(error){announce(`Constructor: ${error.message}`)}
}));
snapshots.append(li);
}
if(!snapshots.children.length)snapshots.append(text('li','Snapshots ще немає.'));
output.append(snapshots);

output.append(text('h4','Published version artifacts'));
const versions=document.createElement('ul');
for(const row of history.versions||[]){
const li=document.createElement('li');
li.append(document.createTextNode(`${row.version_id} · source revision ${row.draft_revision??'—'} · canonical write: ні `));
li.append(makeButton('Rollback у draft',async()=>{
try{await api('authoring.rollback_version',{draft_id:draftId,version_id:row.version_id});announce('Version artifact відновлено у draft як нову revision; canonical content не змінено. Перевідкрийте чернетку.');syncDraftList();await refreshHistory()}catch(error){announce(`Constructor: ${error.message}`)}
}));
versions.append(li);
}
if(!versions.children.length)versions.append(text('li','Version artifacts ще немає.'));
output.append(versions);
}catch(error){output.append(text('p',`Не вдалося прочитати Constructor history: ${error.message}`))}
}

async function mutate(command,message){
try{const draftId=currentDraftId();await api(command,{draft_id:draftId});announce(message);syncDraftList();await refreshHistory()}catch(error){announce(`Constructor: ${error.message}`)}
}

async function installConstructorV2Surface(){
if(mounted)return;
const form=$('authoring-form');
if(!form)return;
try{transport=chooseTransport();const bootstrap=await api('system.bootstrap');if(!bootstrap?.capabilities?.constructor_v2_history)return}catch(_error){return}
mounted=true;
const actions=form.querySelector('.sticky-actions')||form;
actions.append(
makeButton('Snapshot',async()=>{try{const draftId=currentDraftId();await api('authoring.create_snapshot',{draft_id:draftId,label:'Manual snapshot'});announce('Snapshot збережено.');await refreshHistory()}catch(error){announce(`Constructor: ${error.message}`)}}),
makeButton('Undo saved',()=>mutate('authoring.undo','Undo виконано як нову persisted revision. Перевідкрийте чернетку.')),
makeButton('Redo saved',()=>mutate('authoring.redo','Redo виконано як нову persisted revision. Перевідкрийте чернетку.')),
makeButton('History / versions',refreshHistory),
makeButton('Publish saved version',async()=>{
try{const draftId=currentDraftId();const compatibility=(await api('authoring.pack_compatibility',{})).compatibility;const result=await api('authoring.publish_version',{draft_id:draftId,compatibility});announce(`Version artifact ${result.version.version_id} створено. Canonical content не змінено.`);await refreshHistory()}catch(error){announce(`Constructor publish: ${error.message}`)}
}),
);
const section=document.createElement('section');section.id='constructor-v2-panel';section.className='surface subtle';section.setAttribute('aria-labelledby','constructor-v2-heading');
const heading=text('h3','Constructor V2 — історія та версії');heading.id='constructor-v2-heading';heading.tabIndex=-1;
const note=text('p','Операції працюють лише зі збереженою draft revision. Publish створює version artifact для explicit integration review і ніколи не записує canonical source-audited corpus напряму.');
const output=document.createElement('div');output.id='constructor-v2-output';output.setAttribute('aria-live','polite');
section.append(heading,note,output);form.append(section);
}

export {installConstructorV2Surface};
2 changes: 2 additions & 0 deletions lanes/dev1/repair_overlay/frontend/transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ void import('./content-pack-manager.js').then(({installContentPackManagerSurface
void import('./evidence-graph-ui.js').then(({installEvidenceGraphSurface})=>installEvidenceGraphSurface());
// Canonical source-local Witness Matrix is a read-only projection from unlocked runtime evidence.
void import('./witness-matrix-ui.js').then(({installWitnessMatrixSurface})=>installWitnessMatrixSurface());
// Constructor V2 augments the existing AuthoringUI; it remains draft/version-only and capability-gated.
void import('./constructor-v2-ui.js').then(({installConstructorV2Surface})=>installConstructorV2Surface());
Loading
Loading