Skip to content

Commit 468fb64

Browse files
committed
Organize package modules under 400 lines
1 parent dfe3204 commit 468fb64

224 files changed

Lines changed: 22091 additions & 24988 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ssot/registry.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

MUT.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"tools/",
2121
"profiles/",
2222
"src/tigrcorn/profiles/",
23+
"src/tigrcorn/capabilities/schema/runtime-capability-registry.schema.json",
2324
"docs/review/performance/",
2425
"examples/http_entity_static",
2526
"examples/advanced_protocol_delivery",

docs/gov/authoring.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ When sources disagree, use this order:
3131

3232
1. **Definitive machine-readable truth**
3333
- `.ssot/registry.json`
34-
- `tools/ssot_sync.py`
35-
- normalized `.ssot` scaffold bootstrapped from `ssot-registry init`
34+
- normalized `.ssot` scaffold and document rows maintained through the SSOT CLI
3635
2. **Canonical current-state truth**
3736
- `docs/review/conformance/state/CURRENT_REPOSITORY_STATE.md`
3837
- `docs/review/conformance/current_state_chain.current.json`
@@ -106,7 +105,7 @@ When a machine-readable statement exists in `.ssot/registry.json`, prose and der
106105
### If you change canonical truth
107106

108107
Update `.ssot/registry.json` first, then regenerate or reconcile downstream docs and JSON views.
109-
The `.ssot` directory scaffold itself is initialized by `tools/ssot_sync.py` through `ssot-registry init`.
108+
The `.ssot` directory scaffold itself is initialized and maintained through the SSOT CLI.
110109

111110
### If you change CLI behavior
112111

@@ -145,7 +144,7 @@ Confirm path and naming rules in `docs/gov/tree.md`, add `MUT.json` where needed
145144
Run, at minimum:
146145

147146
```bash
148-
python tools/ssot_sync.py --check
147+
uv run ssot validate .
149148
python tools/govchk.py scan
150149
PYTHONPATH=src python -m compileall -q src benchmarks tools
151150
PYTHONPATH=src pytest -q

docs/review/conformance/CONTRACT_PROOF_BOUNDARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ conformance checks.
1414
- `feat:contract-examples` - contract-native and ASGI/3 compatibility examples
1515
live under `examples/contract/`.
1616
- `feat:ssot-contract-boundary-sync` - boundary, feature, claim, test, and
17-
evidence rows are generated by `tools/ssot_sync.py`.
17+
evidence rows are maintained in `.ssot/registry.json` through SSOT CLI operations.
1818
- `feat:contract-release-evidence` - release evidence is rooted at
1919
`docs/review/conformance/releases/0.3.9/release-0.3.9/`.
2020
- `feat:asgi3-app-compat-suite` - ASGI/3 compatibility is covered by the

docs/review/conformance/CURRENT_STATE_CHAIN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This document defines the package-wide current-state chain for the repository.
3838
## Canonical registry source
3939

4040
- `.ssot/registry.json` is the canonical machine-readable governance registry for current-state, boundary, release, claim, evidence, and risk linkage.
41-
- `tools/ssot_sync.py` regenerates `.ssot/registry.json` from the current promoted repository truth.
41+
- SSOT CLI operations maintain `.ssot/registry.json`; validation gates read the committed registry directly.
4242

4343
## Scoped current audits that are **not** package-wide current-state sources
4444

pkgs/tigrcorn-certification/src/tigrcorn_certification/aioquic_preflight.py

Lines changed: 0 additions & 449 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __future__ import annotations
2+
3+
from .helpers import *
4+
from .records import *
5+
from .bundle import *
6+
from .status_docs import *
7+
from .core import *
8+
9+
__all__ = [name for name in globals() if not name.startswith('_')]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
from __future__ import annotations
2+
3+
from .imports import *
4+
from .helpers import *
5+
6+
def _bundle_manifest(*, artifact_root: str, matrix_path: str, scenario_ids: Sequence[str]) -> dict[str, Any]:
7+
return {
8+
'bundle_kind': 'aioquic_adapter_preflight_bundle',
9+
'generated_at': _now(),
10+
'release_gate_eligible': False,
11+
'artifact_root': artifact_root,
12+
'matrix_path': matrix_path,
13+
'scenario_ids': list(scenario_ids),
14+
'note': 'This bundle proves the third-party aioquic HTTP/3 adapters can execute cleanly before strict-target checkpoint promotion work continues.',
15+
}
16+
17+
18+
def _bundle_index(*, artifact_root: str, matrix_path: str, scenario_records: Sequence[Mapping[str, Any]], environment: Mapping[str, Any], gate_status: Mapping[str, Any]) -> dict[str, Any]:
19+
return {
20+
'artifact_root': artifact_root,
21+
'bundle_kind': 'aioquic_adapter_preflight_bundle',
22+
'generated_at': _now(),
23+
'matrix_path': matrix_path,
24+
'scenario_count': len(scenario_records),
25+
'scenario_ids': [str(item['scenario_id']) for item in scenario_records],
26+
'all_adapters_passed': all(bool(item['passed']) for item in scenario_records),
27+
'no_peer_exit_code_2': all(int(item['peer_exit_code']) != 2 for item in scenario_records),
28+
'negotiation_metadata_emitted': all(bool(item['negotiation_metadata_emitted']) for item in scenario_records),
29+
'transcript_metadata_emitted': all(bool(item['transcript_emitted']) for item in scenario_records),
30+
'all_protocols_h3': all(item.get('protocol') == 'h3' for item in scenario_records),
31+
'all_handshakes_complete': all(bool(item['handshake_complete']) for item in scenario_records),
32+
'certificate_inputs_ready': all(bool(item['certificate_inputs_ready']) for item in scenario_records),
33+
'packet_traces_emitted': all(bool(item['packet_trace_exists']) for item in scenario_records),
34+
'qlogs_emitted': all(bool(item['qlog_exists']) for item in scenario_records),
35+
'environment': dict(environment),
36+
'gate_status_after_preflight': dict(gate_status),
37+
'release_gate_eligible': False,
38+
}
39+
40+
41+
def _bundle_summary(index: Mapping[str, Any]) -> dict[str, Any]:
42+
return {
43+
'artifact_root': index['artifact_root'],
44+
'bundle_kind': index['bundle_kind'],
45+
'generated_at': index['generated_at'],
46+
'scenario_count': index['scenario_count'],
47+
'all_adapters_passed': index['all_adapters_passed'],
48+
'no_peer_exit_code_2': index['no_peer_exit_code_2'],
49+
'all_protocols_h3': index['all_protocols_h3'],
50+
'all_handshakes_complete': index['all_handshakes_complete'],
51+
'certificate_inputs_ready': index['certificate_inputs_ready'],
52+
}
53+
54+
55+
def _bundle_readme(index: Mapping[str, Any], scenario_records: Sequence[Mapping[str, Any]]) -> str:
56+
lines = [
57+
'# aioquic adapter preflight bundle',
58+
'',
59+
'This bundle preserves the direct third-party aioquic HTTP/3 adapter preflight runs used before strict-target certification checkpoints.',
60+
'',
61+
'## Exit-criteria status',
62+
'',
63+
f"- all adapters passed: `{index['all_adapters_passed']}`",
64+
f"- no peer exit code 2: `{index['no_peer_exit_code_2']}`",
65+
f"- negotiation metadata emitted: `{index['negotiation_metadata_emitted']}`",
66+
f"- transcript metadata emitted: `{index['transcript_metadata_emitted']}`",
67+
f"- ALPN h3 observed for every run: `{index['all_protocols_h3']}`",
68+
f"- QUIC handshakes complete: `{index['all_handshakes_complete']}`",
69+
f"- certificate inputs ready: `{index['certificate_inputs_ready']}`",
70+
'',
71+
'## Scenarios',
72+
'',
73+
]
74+
for item in scenario_records:
75+
lines.extend([
76+
f"- `{item['scenario_id']}` → passed=`{item['passed']}`, peer_exit=`{item['peer_exit_code']}`, protocol=`{item['protocol']}`, handshake_complete=`{item['handshake_complete']}`",
77+
])
78+
lines.append('')
79+
return '\n'.join(lines) + '\n'
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
from __future__ import annotations
2+
3+
from .imports import *
4+
from .helpers import *
5+
from .records import *
6+
from .bundle import *
7+
from .status_docs import *
8+
9+
def run_aioquic_adapter_preflight(
10+
root: str | Path,
11+
*,
12+
release_root: str = DEFAULT_RELEASE_ROOT,
13+
bundle_name: str = DEFAULT_BUNDLE_NAME,
14+
matrix_path: str = DEFAULT_MATRIX_PATH,
15+
scenario_ids: Sequence[str] = DEFAULT_PRELIGHT_SCENARIOS,
16+
bundle_root: str | Path | None = None,
17+
require_pass: bool = False,
18+
) -> dict[str, Any]:
19+
repo_root = Path(root)
20+
resolved_release_root = repo_root / release_root
21+
target_bundle_root = Path(bundle_root) if bundle_root is not None else resolved_release_root / bundle_name
22+
if target_bundle_root.exists():
23+
shutil.rmtree(target_bundle_root)
24+
target_bundle_root.mkdir(parents=True, exist_ok=True)
25+
26+
with tempfile.TemporaryDirectory(prefix='aioquic-preflight-') as tmpdir:
27+
summary = run_external_matrix(
28+
repo_root / matrix_path,
29+
artifact_root=tmpdir,
30+
source_root=repo_root,
31+
scenario_ids=list(scenario_ids),
32+
strict=True,
33+
)
34+
generated_root = Path(summary.artifact_root)
35+
for source_name, target_name in (
36+
('manifest.json', 'generated_matrix_manifest.json'),
37+
('index.json', 'generated_matrix_index.json'),
38+
('summary.json', 'generated_matrix_summary.json'),
39+
):
40+
shutil.copy2(generated_root / source_name, target_bundle_root / target_name)
41+
for scenario_id in scenario_ids:
42+
shutil.copytree(generated_root / scenario_id, target_bundle_root / scenario_id)
43+
44+
environment = {
45+
'python_version': sys.version,
46+
'python_minor_version': f'{sys.version_info.major}.{sys.version_info.minor}',
47+
'aioquic_version': _module_version('aioquic'),
48+
'wsproto_version': _module_version('wsproto'),
49+
'h2_version': _module_version('h2'),
50+
'websockets_version': _module_version('websockets'),
51+
}
52+
gate_status = {
53+
'authoritative_boundary_passed': evaluate_release_gates(repo_root).passed,
54+
'strict_target_boundary_passed': evaluate_release_gates(repo_root, boundary_path='docs/review/conformance/certification_boundary.strict_target.json').passed,
55+
'promotion_target_passed': evaluate_promotion_target(repo_root).passed,
56+
}
57+
scenario_records = [_extract_scenario_record(repo_root, target_bundle_root, scenario_id) for scenario_id in scenario_ids]
58+
index = _bundle_index(
59+
artifact_root=str(target_bundle_root.relative_to(repo_root)) if target_bundle_root.is_relative_to(repo_root) else str(target_bundle_root),
60+
matrix_path=matrix_path,
61+
scenario_records=scenario_records,
62+
environment=environment,
63+
gate_status=gate_status,
64+
)
65+
manifest = _bundle_manifest(
66+
artifact_root=index['artifact_root'],
67+
matrix_path=matrix_path,
68+
scenario_ids=scenario_ids,
69+
)
70+
summary = _bundle_summary(index)
71+
_dump_json(target_bundle_root / 'manifest.json', manifest)
72+
_dump_json(target_bundle_root / 'index.json', index)
73+
_dump_json(target_bundle_root / 'summary.json', summary)
74+
_dump_json(target_bundle_root / 'preflight.json', {
75+
'generated_at': _now(),
76+
'environment': environment,
77+
'gate_status_after_preflight': gate_status,
78+
'scenario_records': scenario_records,
79+
})
80+
(target_bundle_root / 'README.md').write_text(_bundle_readme(index, scenario_records), encoding='utf-8')
81+
82+
snapshot = {
83+
'checkpoint': 'aioquic_adapter_preflight',
84+
'status': 'aioquic_adapter_preflight_passed' if summary['all_adapters_passed'] else 'aioquic_adapter_preflight_failed',
85+
'current_state': {
86+
'release_root': release_root,
87+
'bundle_root': index['artifact_root'],
88+
'matrix_path': matrix_path,
89+
'scenario_ids': list(scenario_ids),
90+
'scenario_records': scenario_records,
91+
'environment': environment,
92+
'all_adapters_passed': index['all_adapters_passed'],
93+
'no_peer_exit_code_2': index['no_peer_exit_code_2'],
94+
'negotiation_metadata_emitted': index['negotiation_metadata_emitted'],
95+
'transcript_metadata_emitted': index['transcript_metadata_emitted'],
96+
'all_protocols_h3': index['all_protocols_h3'],
97+
'all_handshakes_complete': index['all_handshakes_complete'],
98+
'certificate_inputs_ready': index['certificate_inputs_ready'],
99+
'packet_traces_emitted': index['packet_traces_emitted'],
100+
'qlogs_emitted': index['qlogs_emitted'],
101+
'gate_status_after_preflight': gate_status,
102+
},
103+
'remaining_strict_target_blockers': [
104+
'websocket-http3-server-aioquic-client-permessage-deflate',
105+
'http3-connect-relay-aioquic-client',
106+
'http3-trailer-fields-aioquic-client',
107+
'http3-content-coding-aioquic-client',
108+
],
109+
}
110+
if require_pass and not summary['all_adapters_passed']:
111+
raise AioquicAdapterPreflightError('one or more aioquic adapter preflight scenarios failed')
112+
return snapshot
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
from __future__ import annotations
2+
3+
from .imports import *
4+
5+
class AioquicAdapterPreflightError(RuntimeError):
6+
"""Raised when the aioquic adapter preflight fails and strict pass mode is enabled."""
7+
8+
9+
def _now() -> str:
10+
return datetime.now(timezone.utc).isoformat()
11+
12+
13+
def _load_json(path: Path) -> dict[str, Any]:
14+
return json.loads(path.read_text(encoding='utf-8'))
15+
16+
17+
def _dump_json(path: Path, payload: Any) -> None:
18+
path.parent.mkdir(parents=True, exist_ok=True)
19+
path.write_text(json.dumps(payload, indent=2, sort_keys=True) + '\n', encoding='utf-8')
20+
21+
22+
def _module_version(name: str) -> str | None:
23+
try:
24+
return importlib.metadata.version(name)
25+
except importlib.metadata.PackageNotFoundError:
26+
return None
27+
28+
29+
def _command_option(command: Sequence[str], option: str) -> str | None:
30+
try:
31+
index = list(command).index(option)
32+
except ValueError:
33+
return None
34+
next_index = index + 1
35+
if next_index >= len(command):
36+
return None
37+
return str(command[next_index])
38+
39+
40+
def _module_name(command: Sequence[str]) -> str | None:
41+
try:
42+
index = list(command).index('-m')
43+
except ValueError:
44+
return None
45+
next_index = index + 1
46+
if next_index >= len(command):
47+
return None
48+
return str(command[next_index])
49+
50+
51+
def _path_ready(entry: Mapping[str, Any] | None) -> bool:
52+
if not isinstance(entry, Mapping):
53+
return False
54+
return bool(entry.get('exists')) and bool(entry.get('is_file'))
55+
56+
57+
def _default_certificate_inputs(repo_root: Path, peer_command: Sequence[str]) -> dict[str, Any]:
58+
def _entry(option: str) -> dict[str, Any]:
59+
value = _command_option(peer_command, option)
60+
if value is None:
61+
return {'path': None, 'exists': False, 'is_file': False}
62+
candidate = repo_root / value
63+
return {
64+
'path': value,
65+
'exists': candidate.exists(),
66+
'is_file': candidate.is_file(),
67+
}
68+
69+
ca = _entry('--cacert')
70+
cert = _entry('--client-cert')
71+
key = _entry('--client-key')
72+
client_material_requested = bool(cert['path'] or key['path'])
73+
client_material_ready = (not client_material_requested) or (bool(cert['exists']) and bool(key['exists']))
74+
return {
75+
'ca_cert': ca,
76+
'client_cert': cert,
77+
'client_key': key,
78+
'client_material_requested': client_material_requested,
79+
'client_material_ready': client_material_ready,
80+
'ready': bool(ca['exists']) and client_material_ready,
81+
}
82+
83+
84+
def _scenario_kind(scenario_id: str) -> str:
85+
if 'websocket' in scenario_id:
86+
return 'http3_websocket_adapter'
87+
return 'http3_client_adapter'

0 commit comments

Comments
 (0)