@riddledc/riddle-proof 0.5.28 → 0.5.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-TV3XY7PG.js → chunk-R4BPJNAM.js} +1 -2
- package/dist/engine-harness.cjs +1 -2
- package/dist/engine-harness.js +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.js +1 -1
- package/dist/proof-run-core.cjs +1 -2
- package/dist/proof-run-core.js +1 -1
- package/dist/proof-run-engine.cjs +1 -2
- package/dist/proof-run-engine.js +1 -1
- package/package.json +1 -1
- package/runtime/lib/preflight.py +17 -1
- package/runtime/tests/recon_verify_smoke.py +45 -0
- /package/dist/{chunk-46355FJD.js → chunk-A3H7GU7H.js} +0 -0
|
@@ -69,7 +69,6 @@ function buildSetupArgs(params, config) {
|
|
|
69
69
|
const commitMessage = (params.commit_message || params.change_request || "").trim();
|
|
70
70
|
const captureScript = (params.capture_script || "").trim();
|
|
71
71
|
const requestedReference = params.reference || (params.prod_url ? "both" : "before");
|
|
72
|
-
const reference = !params.prod_url && requestedReference !== "before" ? "before" : requestedReference;
|
|
73
72
|
if (!commitMessage) throw new Error("commit_message is required for setup/run");
|
|
74
73
|
return {
|
|
75
74
|
repo: params.repo,
|
|
@@ -81,7 +80,7 @@ function buildSetupArgs(params, config) {
|
|
|
81
80
|
success_criteria: params.success_criteria || "",
|
|
82
81
|
assertions_json: params.assertions_json || "",
|
|
83
82
|
verification_mode: params.verification_mode || "proof",
|
|
84
|
-
reference,
|
|
83
|
+
reference: requestedReference,
|
|
85
84
|
base_branch: params.base_branch || "main",
|
|
86
85
|
before_ref: params.before_ref || "",
|
|
87
86
|
allow_static_preview_fallback: params.allow_static_preview_fallback ? "true" : "",
|
package/dist/engine-harness.cjs
CHANGED
|
@@ -87,7 +87,6 @@ function buildSetupArgs(params, config) {
|
|
|
87
87
|
const commitMessage = (params.commit_message || params.change_request || "").trim();
|
|
88
88
|
const captureScript = (params.capture_script || "").trim();
|
|
89
89
|
const requestedReference = params.reference || (params.prod_url ? "both" : "before");
|
|
90
|
-
const reference = !params.prod_url && requestedReference !== "before" ? "before" : requestedReference;
|
|
91
90
|
if (!commitMessage) throw new Error("commit_message is required for setup/run");
|
|
92
91
|
return {
|
|
93
92
|
repo: params.repo,
|
|
@@ -99,7 +98,7 @@ function buildSetupArgs(params, config) {
|
|
|
99
98
|
success_criteria: params.success_criteria || "",
|
|
100
99
|
assertions_json: params.assertions_json || "",
|
|
101
100
|
verification_mode: params.verification_mode || "proof",
|
|
102
|
-
reference,
|
|
101
|
+
reference: requestedReference,
|
|
103
102
|
base_branch: params.base_branch || "main",
|
|
104
103
|
before_ref: params.before_ref || "",
|
|
105
104
|
allow_static_preview_fallback: params.allow_static_preview_fallback ? "true" : "",
|
package/dist/engine-harness.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -87,7 +87,6 @@ function buildSetupArgs(params, config) {
|
|
|
87
87
|
const commitMessage = (params.commit_message || params.change_request || "").trim();
|
|
88
88
|
const captureScript = (params.capture_script || "").trim();
|
|
89
89
|
const requestedReference = params.reference || (params.prod_url ? "both" : "before");
|
|
90
|
-
const reference = !params.prod_url && requestedReference !== "before" ? "before" : requestedReference;
|
|
91
90
|
if (!commitMessage) throw new Error("commit_message is required for setup/run");
|
|
92
91
|
return {
|
|
93
92
|
repo: params.repo,
|
|
@@ -99,7 +98,7 @@ function buildSetupArgs(params, config) {
|
|
|
99
98
|
success_criteria: params.success_criteria || "",
|
|
100
99
|
assertions_json: params.assertions_json || "",
|
|
101
100
|
verification_mode: params.verification_mode || "proof",
|
|
102
|
-
reference,
|
|
101
|
+
reference: requestedReference,
|
|
103
102
|
base_branch: params.base_branch || "main",
|
|
104
103
|
before_ref: params.before_ref || "",
|
|
105
104
|
allow_static_preview_fallback: params.allow_static_preview_fallback ? "true" : "",
|
package/dist/index.js
CHANGED
package/dist/proof-run-core.cjs
CHANGED
|
@@ -125,7 +125,6 @@ function buildSetupArgs(params, config) {
|
|
|
125
125
|
const commitMessage = (params.commit_message || params.change_request || "").trim();
|
|
126
126
|
const captureScript = (params.capture_script || "").trim();
|
|
127
127
|
const requestedReference = params.reference || (params.prod_url ? "both" : "before");
|
|
128
|
-
const reference = !params.prod_url && requestedReference !== "before" ? "before" : requestedReference;
|
|
129
128
|
if (!commitMessage) throw new Error("commit_message is required for setup/run");
|
|
130
129
|
return {
|
|
131
130
|
repo: params.repo,
|
|
@@ -137,7 +136,7 @@ function buildSetupArgs(params, config) {
|
|
|
137
136
|
success_criteria: params.success_criteria || "",
|
|
138
137
|
assertions_json: params.assertions_json || "",
|
|
139
138
|
verification_mode: params.verification_mode || "proof",
|
|
140
|
-
reference,
|
|
139
|
+
reference: requestedReference,
|
|
141
140
|
base_branch: params.base_branch || "main",
|
|
142
141
|
before_ref: params.before_ref || "",
|
|
143
142
|
allow_static_preview_fallback: params.allow_static_preview_fallback ? "true" : "",
|
package/dist/proof-run-core.js
CHANGED
|
@@ -110,7 +110,6 @@ function buildSetupArgs(params, config) {
|
|
|
110
110
|
const commitMessage = (params.commit_message || params.change_request || "").trim();
|
|
111
111
|
const captureScript = (params.capture_script || "").trim();
|
|
112
112
|
const requestedReference = params.reference || (params.prod_url ? "both" : "before");
|
|
113
|
-
const reference = !params.prod_url && requestedReference !== "before" ? "before" : requestedReference;
|
|
114
113
|
if (!commitMessage) throw new Error("commit_message is required for setup/run");
|
|
115
114
|
return {
|
|
116
115
|
repo: params.repo,
|
|
@@ -122,7 +121,7 @@ function buildSetupArgs(params, config) {
|
|
|
122
121
|
success_criteria: params.success_criteria || "",
|
|
123
122
|
assertions_json: params.assertions_json || "",
|
|
124
123
|
verification_mode: params.verification_mode || "proof",
|
|
125
|
-
reference,
|
|
124
|
+
reference: requestedReference,
|
|
126
125
|
base_branch: params.base_branch || "main",
|
|
127
126
|
before_ref: params.before_ref || "",
|
|
128
127
|
allow_static_preview_fallback: params.allow_static_preview_fallback ? "true" : "",
|
package/dist/proof-run-engine.js
CHANGED
package/package.json
CHANGED
package/runtime/lib/preflight.py
CHANGED
|
@@ -42,6 +42,7 @@ with open(args_file) as f:
|
|
|
42
42
|
|
|
43
43
|
mode = (s.get('mode') or '').strip().lower()
|
|
44
44
|
reference = s.get('reference', 'both')
|
|
45
|
+
requested_reference = reference
|
|
45
46
|
reference_note = ''
|
|
46
47
|
verification_mode = (s.get('verification_mode') or 'proof').strip() or 'proof'
|
|
47
48
|
s['verification_mode'] = verification_mode
|
|
@@ -68,6 +69,15 @@ if discord_url_match:
|
|
|
68
69
|
if reference not in ('prod', 'before', 'both'):
|
|
69
70
|
raise SystemExit('Invalid reference: ' + reference + '. Must be prod, before, or both.')
|
|
70
71
|
s['reference'] = reference
|
|
72
|
+
prod_url_present = bool((s.get('prod_url') or '').strip())
|
|
73
|
+
s['reference_resolution'] = {
|
|
74
|
+
'requested_reference': requested_reference,
|
|
75
|
+
'effective_reference': reference,
|
|
76
|
+
'prod_reference_requested': requested_reference in ('prod', 'both'),
|
|
77
|
+
'prod_url_present': prod_url_present,
|
|
78
|
+
'prod_reference_skipped': False,
|
|
79
|
+
'prod_reference_skip_reason': '',
|
|
80
|
+
}
|
|
71
81
|
|
|
72
82
|
# Infer a reasonable commit title during setup instead of forcing the caller to
|
|
73
83
|
# fill boilerplate that can be derived from the requested change.
|
|
@@ -77,11 +87,17 @@ if not (s.get('commit_message') or '').strip():
|
|
|
77
87
|
# Setup should not block on a missing production URL. If prod comparison was
|
|
78
88
|
# requested but prod_url is not known yet, continue with a before-only setup so
|
|
79
89
|
# the repo homework can happen first.
|
|
80
|
-
if reference in ('prod', 'both') and not
|
|
90
|
+
if reference in ('prod', 'both') and not prod_url_present:
|
|
81
91
|
s['requested_reference'] = reference
|
|
82
92
|
reference = 'before'
|
|
83
93
|
s['reference'] = reference
|
|
84
94
|
reference_note = 'prod_url not provided; setup will continue with reference=before until prod is known.'
|
|
95
|
+
s['reference_resolution'].update({
|
|
96
|
+
'effective_reference': reference,
|
|
97
|
+
'prod_reference_skipped': True,
|
|
98
|
+
'prod_reference_skip_reason': 'prod_url_not_provided',
|
|
99
|
+
'note': reference_note,
|
|
100
|
+
})
|
|
85
101
|
|
|
86
102
|
# Parse optional assertions JSON
|
|
87
103
|
parsed_assertions = None
|
|
@@ -11,6 +11,7 @@ from pathlib import Path
|
|
|
11
11
|
ROOT = Path(__file__).resolve().parents[1]
|
|
12
12
|
LIB = ROOT / 'lib'
|
|
13
13
|
UTIL_PATH = LIB / 'util.py'
|
|
14
|
+
PREFLIGHT_PATH = LIB / 'preflight.py'
|
|
14
15
|
RECON_PATH = LIB / 'recon.py'
|
|
15
16
|
VERIFY_PATH = LIB / 'verify.py'
|
|
16
17
|
AUTHOR_PATH = LIB / 'author.py'
|
|
@@ -593,6 +594,49 @@ def temporary_env(**updates):
|
|
|
593
594
|
os.environ[key] = value
|
|
594
595
|
|
|
595
596
|
|
|
597
|
+
def run_preflight_records_prod_reference_skip_reason():
|
|
598
|
+
tempdir = Path(tempfile.mkdtemp(prefix='riddle-proof-preflight-reference-'))
|
|
599
|
+
args_path = tempdir / 'args.json'
|
|
600
|
+
state_path = tempdir / 'state.json'
|
|
601
|
+
repo_dir = tempdir / 'repo'
|
|
602
|
+
try:
|
|
603
|
+
make_project(repo_dir, "export const routes = [{ path: '/pricing', element: <Pricing /> }];\n")
|
|
604
|
+
args_path.write_text(json.dumps({
|
|
605
|
+
'repo': 'example/repo',
|
|
606
|
+
'repo_dir': str(repo_dir),
|
|
607
|
+
'mode': 'static',
|
|
608
|
+
'reference': 'both',
|
|
609
|
+
'prod_url': '',
|
|
610
|
+
'change_request': 'Make the pricing CTA clearer',
|
|
611
|
+
'commit_message': 'Make the pricing CTA clearer',
|
|
612
|
+
'success_criteria': 'Pricing CTA is visible.',
|
|
613
|
+
'verification_mode': 'text',
|
|
614
|
+
'build_command': BUILD_SCRIPT,
|
|
615
|
+
'build_output': 'build',
|
|
616
|
+
'allow_static_preview_fallback': True,
|
|
617
|
+
'server_path': '/pricing',
|
|
618
|
+
}, indent=2))
|
|
619
|
+
with temporary_env(
|
|
620
|
+
RIDDLE_PROOF_ARGS_FILE=str(args_path),
|
|
621
|
+
RIDDLE_PROOF_STATE_FILE=str(state_path),
|
|
622
|
+
):
|
|
623
|
+
load_module('util_preflight_reference_skip', UTIL_PATH)
|
|
624
|
+
load_module('preflight_reference_skip', PREFLIGHT_PATH)
|
|
625
|
+
after_preflight = json.loads(state_path.read_text())
|
|
626
|
+
assert after_preflight['requested_reference'] == 'both'
|
|
627
|
+
assert after_preflight['reference'] == 'before'
|
|
628
|
+
assert after_preflight['reference_resolution']['requested_reference'] == 'both'
|
|
629
|
+
assert after_preflight['reference_resolution']['effective_reference'] == 'before'
|
|
630
|
+
assert after_preflight['reference_resolution']['prod_reference_skipped'] is True
|
|
631
|
+
assert after_preflight['reference_resolution']['prod_reference_skip_reason'] == 'prod_url_not_provided'
|
|
632
|
+
return {
|
|
633
|
+
'ok': True,
|
|
634
|
+
'reference_resolution': after_preflight['reference_resolution'],
|
|
635
|
+
}
|
|
636
|
+
finally:
|
|
637
|
+
shutil.rmtree(tempdir, ignore_errors=True)
|
|
638
|
+
|
|
639
|
+
|
|
596
640
|
def base_state(tempdir: Path, *, reference='before', prod_url=''):
|
|
597
641
|
before_dir = tempdir / 'before'
|
|
598
642
|
after_dir = tempdir / 'after'
|
|
@@ -1740,6 +1784,7 @@ def run_ship_resolves_real_pr_branch():
|
|
|
1740
1784
|
|
|
1741
1785
|
if __name__ == '__main__':
|
|
1742
1786
|
payload = {
|
|
1787
|
+
'preflight_reference_skip_reason': run_preflight_records_prod_reference_skip_reason(),
|
|
1743
1788
|
'capture_artifact_enrichment': run_capture_artifact_enrichment(),
|
|
1744
1789
|
'capture_diagnostics_redaction': run_capture_diagnostics_redact_sensitive_values(),
|
|
1745
1790
|
'apply_auth_context': run_apply_auth_context_passes_supported_auth_payloads(),
|
|
File without changes
|