Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3fe55bf
spec(sync): propose indexed EDSL public interface
RCmerci Nov 15, 2026
e12774a
spec(sync): separate pure graph DSL and execution contracts
RCmerci Nov 15, 2026
1d3180e
spec: inject per-operation typed completion callbacks
RCmerci Nov 15, 2026
2e31ef2
spec(sync): define structured Eio tasks and bounded service ownership
RCmerci Nov 16, 2026
54b0bc7
spec(sync): complete outbox, observation and bounded asset contracts
RCmerci Nov 16, 2026
d02e5a3
spec(sync): recover empty pulls and separate snapshot budgets
RCmerci Nov 16, 2026
2c94376
spec(sync): close typed producer and network deadline contracts
RCmerci Nov 16, 2026
3ef81c1
docs(sync): minimize interface comments and MLI guidance
RCmerci Nov 16, 2026
5788c9d
Refine sync program names and Eio effect ownership
RCmerci Nov 16, 2026
84764d3
spec(sync): add minimal public sync service interface
RCmerci Nov 17, 2026
c01fe40
spec(sync): complete service inputs and failure contracts
RCmerci Nov 18, 2026
fa20ad1
spec(sync): bind status listener to service lifecycle
RCmerci Nov 18, 2026
8036863
spec(sync): enforce one-shot close and concise contracts
RCmerci Nov 18, 2026
5651ae6
spec(sync): complete service ingress and replacement contracts
RCmerci Nov 18, 2026
685f3b6
docs(sync): trim interface comments
RCmerci Nov 18, 2026
6357793
spec(sync): remove redundant worker command layer
RCmerci Nov 18, 2026
e9a3759
feat(sync): implement typed DSL runtime and pure workflow tests
RCmerci Nov 18, 2026
df66eb4
refactor(sync): migrate App lifecycle and remove legacy runtime
RCmerci Nov 19, 2026
2829265
fix(build): preserve valid empty native stub archives
RCmerci Nov 19, 2026
ebb7081
fix(sync): bound encrypted bootstrap and validate checksums atomically
RCmerci Nov 19, 2026
42b6f12
fix(sync): serialize activation observations and publish Worker readi…
RCmerci Nov 19, 2026
6b13e3b
fix(sync): gate restored accounts on verified authentication
RCmerci Nov 19, 2026
70c5aee
test(sync): assert restored reset network permission independently
RCmerci Nov 19, 2026
4a85af1
test(sync): await real Changes ownership before reset
RCmerci Nov 19, 2026
bd44294
fix(sync): verify stable echo identities and expose real convergence
RCmerci Nov 19, 2026
de9fc61
fix(sync): settle ACK-only assets and add isolated acceptance tooling
RCmerci Nov 19, 2026
8b567b8
fix(sync): reconcile original-owner staging and recover graph lifecycle
RCmerci Nov 19, 2026
3c92f07
fix(app): discard persisted drafts when Send is accepted
RCmerci Nov 19, 2026
38e0170
fix(sync): classify closed upload networks and preserve typed causes
RCmerci Nov 19, 2026
0ac9ae4
fix(crypto): normalize RSA private-key formats before Security import
RCmerci Nov 20, 2026
cbe0e2d
fix(tool): scope acceptance fixtures to explicit private work roots
RCmerci Nov 20, 2026
fc8834b
fix(app): distinguish unavailable capture capabilities from failures
RCmerci Nov 20, 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
6 changes: 6 additions & 0 deletions .agents/skills/journal-build/references/native-provenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ requires the OCaml runtime and mldoc. XMLm is a locked dependency used by mldoc'
OPML units; an unused XMLm unit may be removed by the OCaml linker. Any unresolved
XMLm reference is rejected. No application anchor or global `-linkall` is needed.

## Explicit sync-network diagnostic role

`--sync-network-probe` is a separate producer/import role, not a production feature or a raw-object exception. Its schema-2 envelope, hash-bound source/link records and Dune rule name the whitelisted `tool/sync_acceptance_probe/native_probe.exe.o`; imports reject absent or different roles/targets. Probe source identity includes that directory's native sources as well as the unchanged production source selection. A complete hash-bound current Dune/lock/static-link configuration snapshot permits this explicitly authorized diagnostic target to be produced from an uncommitted worktree; later changes fail closed. Ordinary production imports retain their existing producer-commit configuration guard. Probe receipts must themselves bind the probe role and cannot become production acceptance. Original compiler, archive, runtime header, target C/GMP, mldoc, source and final-input checks remain in force. Manifests separately record production-code source validation, `production_acceptance=false` and `cross_abi_validated=false`.

The diagnostic requires `--configuration debug`. New producers bind configuration and the actual queried Dune profile in immutable source/link records and retain the Dune query with its rule; import compares these against the requested configuration and selected target. Historical envelopes without configuration/profile proof require a producer rerun, never an inferred default. Final acceptance re-queries the same profile and whitelisted target and rejects a changed normalized rule even when file/tool hashes still match.

## Ordinary archive inputs (schema 2)

New producers use `schema_version: 2`, with hash-bound `source` and `link` records
Expand Down
2 changes: 2 additions & 0 deletions .agents/skills/journal-build/references/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ All targets are arm64 with deployment target >=26.0. Choose an external `--cache

Default iOS runtime builds and raw `JOURNAL_OCAML_OBJECT`/extra-object injection are refused. Existing `lui_probe_host.py` callers keep `--native-object`: the helper selects isolated `--probe-native-object` or explicit `--link-only` when absent, with its own host-local cache. Probe import requires external staged Swift/plist, a distinct `-probe` bundle ID, a matching macOS/Simulator object and runtime/bridge symbols; it hashes the object before/after building. It never restamps, accepts device builds or claims production source/ABI proof. Warm-start Simulator inputs must already match Simulator.

The separate real-App sync diagnostic uses `--sync-network-probe` on both the macOS `--producer-only` invocation and the Simulator `--experimental-host-restamp --native-manifest` import. It whitelists `tool/sync_acceptance_probe/native_probe.exe.o`, keeps locked production dependencies and maintained Swift sources, and packages `com.logseq.journal.sync-probe` with `JournalSyncNetworkProbe=true`. It is not `--probe-native-object`: raw imports, stubs, device builds and ordinary macOS Apps are refused for this role. Role/target/source/configuration evidence and cache identities are distinct; cross-role imports fail closed. See the [probe runbook](../../../../tool/sync_acceptance_probe/README.md) for review gates, isolated runner opt-in, private launch inputs and heartbeat supervision. Only the main acceptance owner installs/launches a fresh device; these diagnostics never establish ordinary production acceptance.

Host ARM64 OCaml/runtime restamping is an experimental compatibility route, **not verified full iOS cross-compilation or ABI acceptance**. Real target C/Swift and signing checks do not establish full OCaml ABI or startup acceptance.

Simulator signing is adhoc. macOS development signing needs `--sign-identity` plus `JOURNAL_MACOS_TEAM_ID`; device mode requires the existing signing inputs shown below.
Expand Down
143 changes: 119 additions & 24 deletions .agents/skills/journal-build/scripts/journal_build.py

Large diffs are not rendered by default.

32 changes: 28 additions & 4 deletions .agents/skills/journal-build/scripts/run_isolated_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import hashlib
import json
import os
from pathlib import Path
import re
import shutil
Expand Down Expand Up @@ -36,6 +37,8 @@ def main():
parser.add_argument('--runtime', required=True)
parser.add_argument('--device-type', required=True)
parser.add_argument('--jobs', type=jobs, default=4)
parser.add_argument('--sync-network-probe', action='store_true',
help='separate real-App diagnostic; never ordinary production acceptance')
args = parser.parse_args()
evidence = args.evidence_dir.expanduser().resolve()
if evidence == ROOT or ROOT in evidence.parents:
Expand All @@ -54,11 +57,14 @@ def main():
def save():
(run / 'session.json').write_text(json.dumps(report, indent=2) + '\n')

def command(label, *argv, cwd=ROOT):
if args.sync_network_probe:
report.update(role='sync-network-probe', production_acceptance=False)

def command(label, *argv, cwd=ROOT, env=None):
argv = list(map(str, argv))
report['commands'].append(dict(label=label, argv=argv))
save()
result = subprocess.run(argv, cwd=cwd, text=True, capture_output=True,
result = subprocess.run(argv, cwd=cwd, env=env, text=True, capture_output=True,
timeout=1800 if label in {'producer', 'simulator'} else 300)
(run / (label + '.stdout')).write_text(result.stdout)
(run / (label + '.stderr')).write_text(result.stderr)
Expand All @@ -69,14 +75,19 @@ def command(label, *argv, cwd=ROOT):
return result

def build(label, *options):
result = command(label, 'bash', BUILDER, *options,
role = ['--sync-network-probe'] if args.sync_network_probe else []
result = command(label, 'bash', BUILDER, *options, *role,
'--lui-package', args.lui_package.resolve(),
'--cache-dir', evidence / 'build cache', '--jobs', args.jobs)
matches = re.findall(r'^manifest: (.+)$', result.stderr, re.MULTILINE)
if len(matches) != 1:
raise RuntimeError(f'{label}: missing unique current manifest')
path = Path(matches[0])
manifest = json.loads(path.read_text())
if args.sync_network_probe and (
manifest.get('native_entry', {}).get('role') != 'sync-network-probe'
or manifest.get('production_acceptance') is not False):
raise RuntimeError(f'{label}: missing explicit probe role')
report[label] = dict(manifest=str(path), sha256=hashlib.sha256(path.read_bytes()).hexdigest())
return manifest

Expand All @@ -100,6 +111,10 @@ def build(label, *options):
app = Path(target['artifact']['app'])
report['app'] = str(app)
report['bundle_id'] = target['artifact']['info']['CFBundleIdentifier']
if args.sync_network_probe and (
report['bundle_id'] != 'com.logseq.journal.sync-probe'
or target['artifact']['info'].get('JournalSyncNetworkProbe') is not True):
raise RuntimeError('Simulator artifact is not the separate sync probe')
for name, digest in target['artifact']['files'].items():
if hashlib.sha256((app / name).read_bytes()).hexdigest() != digest:
raise RuntimeError(f'artifact changed after build: {name}')
Expand All @@ -119,7 +134,16 @@ def build(label, *options):
command('bootstatus', 'xcrun', 'simctl', 'bootstatus', udid, '-b')
verify_manifest_sources(target, source_inputs())
command('install', 'xcrun', 'simctl', 'install', udid, app)
command('launch', 'xcrun', 'simctl', 'launch', udid, report['bundle_id'])
launch_env = None
if args.sync_network_probe:
container = Path(command('data-container', 'xcrun', 'simctl', 'get_app_container',
udid, report['bundle_id'], 'data').stdout.strip()).resolve()
control = Path(tempfile.mkdtemp(prefix='sync-network-probe-', dir=container / 'tmp')).resolve()
control.chmod(0o700)
report['network_probe'] = dict(directory=str(control), status=str(control / 'status.json'),
offline_signal=str(control / 'offline'))
launch_env = dict(os.environ, SIMCTL_CHILD_JOURNAL_SYNC_NETWORK_PROBE_DIRECTORY=str(control))
command('launch', 'xcrun', 'simctl', 'launch', udid, report['bundle_id'], env=launch_env)
command('container', 'xcrun', 'simctl', 'get_app_container', udid, report['bundle_id'], 'app')
command('screenshot', 'xcrun', 'simctl', 'io', udid, 'screenshot', run / 'launch.png')
report['status'] = 'launched'
Expand Down
Loading
Loading