Repository navigation
Show current readiness before dated receipts in local pages - #891
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b66de07b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if spec is None or spec.loader is None: | ||
| raise ValueError("native readiness module is unavailable") | ||
| native = importlib.util.module_from_spec(spec) | ||
| spec.loader.exec_module(native) |
There was a problem hiding this comment.
Verify the pinned reader before executing it
When --root points to a modified or untrusted checkout, exec_module() runs the selected build_readiness.py before guard_native() verifies its policy-pinned SHA-256 later in refresh(). A reader that should be rejected can therefore execute arbitrary top-level Python code before the hash mismatch is reported; verify the captured bytes against the policy before importing or execute only the already-verified bytes.
Useful? React with 👍 / 👎.
| relative = path.relative_to(base).as_posix() | ||
| except ValueError: | ||
| continue | ||
| self.validate("override:" + key, source_root, relative) |
There was a problem hiding this comment.
Check all matching roots before rejecting an override
When --state-root is located inside --root (or equals it), a valid state override is first found relative to the repository root, and this call immediately raises because the policy grants it under state; the loop never tries the matching state root. Consequently every default state-backed override fails despite having an exact policy grant. Continue to the next matching root after a role mismatch, or prefer the most specific root.
Useful? React with 👍 / 👎.
| with path.open("rb") as handle: | ||
| raw = handle.read(MAX_BYTES + 1) | ||
| stat = os.fstat(handle.fileno()) |
There was a problem hiding this comment.
Reject nonregular snapshot inputs before blocking on them
When an approved input that does not pass through _check_target()—notably an allowlisted roadmap reference—is a FIFO or another nonregular file, this blocking open/read occurs before fstat() and can hang the refresh indefinitely. no_symlinks() does not reject such files, so a stale or hostile local-state entry defeats the documented finite refresh; open nonblocking and verify that the descriptor is a bounded regular file before reading, as the native-source guard already does.
Useful? React with 👍 / 👎.
| return local.strftime("%b %d, %H:%M:%S %Z") + "; " + utc.strftime("%b %d, %H:%M:%S UTC") | ||
| return (f'<time datetime="{esc(value)}">{local.strftime("%b %d, %H:%M:%S %Z")}</time>' | ||
| f'<small>{utc.strftime("%b %d, %H:%M:%S UTC")}</small>') |
There was a problem hiding this comment.
Include the year in visible current-view timestamps
When a retained observation, event, or owner deadline is from a different calendar year than the reader assumes, both visible formats omit the year even though the hidden datetime attribute retains it. This makes archived or cross-year snapshots appear current and can misstate scheduling context on the readiness and Sources pages; include the year in both the New York and UTC labels.
Useful? React with 👍 / 👎.
| if receipt.is_relative_to(output_dir): | ||
| raise ValueError("refresh receipt must be outside the served root") |
There was a problem hiding this comment.
Reject receipt paths that contain the output directory
When --output-dir is nested below the path supplied as --receipt, this one-way containment check passes. During publish(), creating the output parents turns the intended receipt path into a directory, the page replacements then succeed, and the final receipt replacement fails with IsADirectoryError, leaving newly served pages without their matching receipt even in the absence of an external I/O fault. Reject reverse containment before publication as well.
Useful? React with 👍 / 👎.
| host = unquote(parsed.hostname or "").lower() | ||
| path = unquote(parsed.path).lower() | ||
| except ValueError: | ||
| return False | ||
| return parsed.scheme.lower() in {"http", "https"} and (host in {"chatgpt.com", "chat.openai.com"} or host == "claude.ai" and path.startswith("/artifact")) |
There was a problem hiding this comment.
Normalize browser-equivalent backslashes before classifying URLs
When source text uses an account URL such as https://chatgpt.com\c/private, urlsplit() reports chatgpt.com\c as the hostname, so this classifier and the regex sanitizer both preserve it. Browsers normalize that backslash to /, and owner_link() consequently emits a clickable link to the private ChatGPT URL that the account-artifact policy intends to omit. Reject backslashes or classify after browser-equivalent URL normalization.
Useful? React with 👍 / 👎.
Scope
The local source pages use independent exact path permissions before native or linked file access, preserve raw receipt custody and render portable text. FIX3
0b66de07b6e1437084ab39e1f0ac7dce802f8b93adds four permissions from current main so the default refresh continues after merge, tests policy/index parity and fail-closed policy handling, and documents the four flags' actual permitted files.e48de2e6fa1dd3b740af4793ea5824ea35476dba(main merge base); FIX3 parent7fac0184674168898e51787c85069fc35d2bb47f.lane:foundation.tools/local-pages/source_policy.json, its test module and README. All earlier read-boundary, port21090, redirect, sanitizer, date/reset and view corrections remain in the PR.SOTA sources
958a6d1ab770c807c5ee59748475a5c14df7ba52, SHA-2564cdfe0a722a8e2a620551f5b092e2db762555deb06eef085686623561996dcd2: independently approved exact root/path declarations forcc_g2_started,cc_g2_started_correction,cc_g5_closureandcc_g6_f9.59428d63e09bab10e216e86af377891f8546aca6b3f9cc08c59d0803573b57b0: original reader/portable export APIs under a module-local version-bound guard.discover()/module assignment and.github/workflows/validate.yml:265; installed CPython3.13.16unittest discovery is the native harness.os.open/fstat/O_NOFOLLOW, urllib redirect-handler and zoneinfo interfaces remain the implementation sources for safe reads, loopback collection and New York timestamps.e4a149c1fa20ab42647f71090aa6e1442369605a89cdb22121d242ebf95a8eba; prior policy/read-boundary evidence retained. No dependency, installation or upstream fork introduced.Evidence-class table
local_integrationlocal_integrationlocal_integrationwith synthetic inputslocal_integrationlocal_integrationwith synthetic inputssource_reviewLocal commands run
Each test command used
nice -n 10 ionice -c2 -n7 timeout 600:114 tests PASS:101page/native and13selector. The maintained pre-cue tool has no existing modified testfiles at the main merge base because these page modules are new in this PR; it does not replace executed tests. No expectation change in FIX3.
CI-selection investigation corrects the omission claim: the workflow runs eight native shards;
discover()usestest*.pywithout an allowlist and already selects all five local-page modules. Workflow/selector bytes equal both7fac018 and fetched main958a6d1, so duplicate selection was unnecessary.Decision record
research/fullspeed-20261008/g5-stars-gap/local-pages/architecture/stack-891-fix3-review.mdunder the local state root records the exact source grants, old-policy failure/new-policy parity, tests and CI-selection proof. Policy SHA-256872bf19a9469e519cc1d4e08331689b5cdcf05db8c2bd7d9ccf85bcafb43886a:28direct roles, with the existing exact index/supporting/SDK/override sets preserved. Missing/malformed policy and all unlisted input refusals happen before native file access.Host evidence
No registered host evidence changes or component/provider E2E inferred from fixtures. #899/#913 rebase onto FIX3; both reader micros, required CI/pre-cue and bottom-up CC landing cues through5f remain mandatory. F5 pruning remains separate.
Checklist