Skip to content

Plain-words documentation, format_time quoting fix, scratch-filesystem and release-candidate test fixes - #712

Merged
luisleo526 merged 17 commits into
mainfrom
merge/plain-words-format-time-tests
Nov 2, 2026
Merged

luisleo526 merged 17 commits into
mainfrom
merge/plain-words-format-time-tests

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

What

One branch that carries four reviewed changes together, so the strict queue lands them once with one verification run and one parity measurement. Each change keeps its own reviewed commits; the branch joins them with merge commits and alters no hunk.

  1. Plain words in documentation, comments and public text (one commit, plus a checker). Past measurements and working labels in public text are described in plain words, and scripts/check_public_role_words.py with scripts/test_check_public_role_words.py refuses working labels in public text from now on. No code token changes.
  2. test_run_json_bounded_transport classifies its scratch filesystem (two commits, tests and one docs paragraph). The row reads the filesystem class of its scratch directory from /proc/self/mountinfo and asserts what is true on each class. disk and unknown keep the strict one-page cache bound; overlay and tmpfs end in a pytest skip that names the class. Python peaks, byte counts and cleanup assertions stay strict on every class. ctest hides the output of a passing test, so on an overlay or tmpfs scratch directory this row reports Passed in the ctest log and the one-page bound is asserted nowhere in that run; the skip reason shows when the test is run directly with pytest or when it fails.
  3. str.format_time keeps quoted spans literal and writes a single Z as the numeric UTC offset (four commits: 18 native assertions of the explicit patterns, the preservation tests, the fix in src/str_utils.cpp, and three documentation lines). The old fixed buffer was read past its end when the result did not fit; the fix sizes the buffer from a derived ceiling and reports the existing coded out-of-memory error beyond it.
  4. Release-candidate versions and ratio tolerance in two tests (two commits). repository_release_versions() accepts X.Y.Z with an optional -rc.N suffix and still refuses every other spelling; four timing-ratio rows compare with a relative tolerance instead of ==. The release-candidate bump rows are a synthetic check that report bytes do not depend on the version; they do not state the release rule.

Limits of the evidence for the str.format_time change

Measured on glibc (aarch64) only; macOS and non-C locales were not run. No mutant covers the growth-ceiling guard, the unmatched-quote path or the named-zone tm_gmtoff path. The non-size zero-return branch was inspected in the source only. Quoted spans with % inside and a single Z outside quotes were measured against TradingView; the unmatched-quote behaviour was not, and the documentation does not call it measured.

Checked

  • One clean 8-step verification job on the branch head (preflight, release, debug, sanitizers, kernel, docs, corpus parity, parity subset) and one parity sweep against the current codegen main, both started after the head commit.
  • No product code outside src/str_utils.cpp changes; no deadline or time limit is added to any test.

🤖 Generated with Claude Code

luisleo526 and others added 13 commits October 30, 2026 15:37
…nce compares in ratio rows

Follow-up to the lower-feed sampling and release-bump change (#647).

The replay-off golden test read VERSION with a strict X.Y.Z pattern, so a
release-candidate VERSION such as 1.9.1-rc.1 failed the test instead of being
bumped. repository_release_versions() now accepts X.Y.Z with an optional
-rc.N suffix, bumps from the numeric core, and still refuses anything else
(1.9, v1.9.1, 1.9.1-garbage, 1.9.1-rc, 1.9.1-rc., 1.9.1-rc.1-extra, empty).
Rows cover 1.9.1-rc.1 and 10.20.30-rc.12 and the refused spellings; the
function takes an optional text argument so the rows do not depend on the
repository VERSION.

The golden test that only checks the recorded records for structure is renamed
to say so (..._and_golden_records_are_well_formed) and its comment moved above
the test.

The four ratio_timing rows in test_native_intrabar_lower_lookup compared
doubles with ==; they now use a relative tolerance helper. The verdict checks
against kShapeBound are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tem and asserts what is true on each class

The row measures page-cache residency and flat Python peaks of the report/artifact path against pytest's tmp_path. On a container overlay filesystem or on tmpfs the residency property cannot hold, so the row failed there while it passes on a VM disk.

- docker/run_json_bounded_transport_test.py: a helper reads the filesystem class of the scratch directory from /proc/self/mountinfo (longest matching mount, escaped mount paths), with classes overlay, tmpfs, disk and unknown. disk and unknown keep the strict one-page bound exactly as before; overlay and tmpfs end in a pytest.skip that names the class (no tautology). Python peaks, byte and cleanup assertions stay strict on every class. The class is logged at the start and named in the failure messages. Helper rows (classification, nested mounts, missing evidence, class verdicts) are plain behaviour rows with no clock; the control rows turn red when the disk bound is loosened or when unknown is treated as non-disk.
- tests/cr150.d/core-cr150-o1w-pyjson.cmake: the registration passes -rPs so the skip reason shows in the CI log; the arguments are separated by spaces (-q -rPs -p no:cacheprovider).
- docs/ci.md: one paragraph describing the row and what it asserts on each class; adjacent prose is reflowed so the document keeps its line count (2016) that the preflight pins.

This re-authors the earlier attempt on current main and fixes its two failures (the missing space in the registration line, and the documented line count).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Eighteen literal cases call the real formatter with fixed timestamps, patterns
and zones and compare the returned text and its length with measured
TradingView output: the full ISO-style pattern in four zones across two
seasons, the numeric offset token alone in the same zones and seasons, a
pattern with quoted date-token letters, and a doubled apostrophe inside a
quoted literal. The test prints one PASS or FAIL line per case and returns
non-zero when any case differs.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Takes the changes that landed on main since the branch point so the branch is main plus this change. No conflict; no hunk of the branch was altered.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…use working labels in public text

Source comments and design pages still referred to earlier work by working
labels (numbered work rounds, card-like names, phrases naming who decided,
a local-time stamp). A reader outside the project cannot follow them. Every
such mention in docs/, README.md, CHANGELOG.md, src/ and include/ now says
what was measured or decided: the instrument, timeframe, price and count are
kept, only the label is replaced by a description. Comments and prose only:
no code, string literal, identifier, macro, include or directive changes,
and no line count changes in any touched file. One content pin
(tests/pine_input_domain_gates.json) quotes a reworded comment inside its
window text and follows the new wording; its code lines are unchanged.

The sentences that carried those labels were added by earlier commits; the
doc-reverts check lists them as deletions, so they are named here:
c619f5f, e3e20cb, 0d76a09, d093560, 1e360bd, f064b1c, 665a917, 5da2668,
b97c409, cfbe677, f10f0cc, b2a578c, caa65e4, 1eef78e. Each sentence is
reworded, not dropped: the fact it states is kept without its label.

scripts/check_public_role_words.py widens the existing public-words check to
the same class (role tokens plus the working labels above). It reads every
file in scope as strict UTF-8, fails on an unreadable or undecodable file, a
failed file listing or an empty scope, and prints file and line for each hit.
scripts/test_check_public_role_words.py has one fixture per token kind, a
clean tree, an undecodable file, and a mutation row that replaces the pattern
with one that never matches and requires the failing rows to fail. The
preflight runs the test module and then the check as serial stages.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Takes the changes that landed on main since the branch point so the branch is main plus this change. No conflict; no hunk of the branch was altered.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…h and raw directives

The new test calls the real formatter with fixed timestamps, patterns and zones
and compares the returned text and its length. It holds three kinds of rows:

- rows that characterize what the formatter returns today for literal letters,
  repeated Pine tokens, ordered mapping, raw strftime directives, unmatched
  quotes and the empty format (the rows that depend on glibc's spelling are
  compiled only where glibc is the C library);
- rows that fail today because a quoted span is expanded instead of kept
  literal, including the two measured TradingView strings, and one row whose
  output is longer than 256 bytes;
- one growth row whose output fits the old buffer but not the new initial one.

Only the test and its registration in tests/CMakeLists.txt change; no source
file is touched.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eric offset, and size the output from the format

A pattern such as "yyyy '%Y' Z" returned the quote characters and expanded the
percent directive inside the quoted span, and a lone Z stayed the letter Z.
TradingView keeps a quoted span literal (a percent sign inside quotes is not
expanded) and writes a lone Z as the numeric offset. The formatter now

- scans quoted spans and leaves their content untouched, dropping the quotes;
  an unmatched quote keeps the previous behaviour;
- writes a lone Z as the numeric UTC offset (+hhmm) of the formatted time;
- grows its output buffer from the format itself: the previous fixed buffer was
  read past its end when the result did not fit. The growth ceiling is derived
  from the format (its length, its directive count and the widest width it
  writes), so a width a script writes is still honoured and nothing is capped by
  a fixed number; past the ceiling the formatter stops with the existing coded
  out-of-memory error instead of growing without bound.

The measured rows of tests/test_str_format_time_preservation.cpp (quoted spans,
the singleton Z, and a result longer than 256 bytes) fail on the previous
formatter by a wrong string and pass with this change; the other rows pin what
the formatter returns today. Rows that depend on glibc's spelling are compiled
only where glibc is the C library. Not covered: a libc that returns zero for an
unsupported conversion (source-inspected only), non-C locales, macOS.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…Z as the numeric offset

State, in the two coverage pages that describe pine_str_format_time, what
TradingView was measured to do and the formatter now does: a span in single
quotes is literal (a percent sign inside it is not expanded), and a single Z
outside quotes is the numeric UTC offset (+hhmm). An unmatched quote keeps the
previous behaviour; that case has not been measured.

Three lines change in two files; no line is added or removed, so line-number
anchors in the docs stay valid.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Brings in the reviewed commit that describes past measurements in plain words and refuses working labels in public text, together with the checker that enforces it. No hunk of the merged commit was altered.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…test

Brings in the reviewed commits that make the bounded-transport row classify its scratch filesystem and assert what holds on each class. No hunk of the merged commits was altered.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ocumentation

Brings in the reviewed commits that keep quoted spans literal and write a lone Z as the numeric offset, with the native assertions that pin the behaviour and the documentation lines that state it. No hunk of the merged commits was altered.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Brings in the reviewed commits that let the replay golden rows accept a release-candidate version and compare timing ratios with a tolerance. No hunk of the merged commits was altered.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
import subprocess
import sys
import tempfile
import unittest

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View in Graphify

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Adds scratch-filesystem classification to the bounded-transport tests: _mount_filesystem_class parses /proc/self/mountinfo to pick the deepest mount containing the temp path, and _filesystem_class treats any fstype name other than overlay or tmpfs as disk. The new _assert_cache_residency keeps the strict one-page cache bound on disk and on unknown backing, but skips with an explicit reason on overlay and tmpfs instead of passing green. The detected filesystem is recorded as a pytest property and included in the peak-memory and cache assertion messages, with new parametrized tests covering the classifier, mount matching, escaped mount paths, missing evidence, and the residency verdicts.

Worth a look

  • Stacked mounts on the same mount point resolve to the shadowed (first) entry instead of the visible (last) one — docker/run_json_bounded_transport_test.py:66 · Escalate · medium
    • NOT verified (no proof, no reproducing execution) — needs human review

Review partial — this diff was larger than one review pass covers, so later files were not reviewed; some findings may be missing.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 12084 functions depend on the 7086 functions this change touches.

Health — this change adds coupling hotspots:

  • new: time_format_pattern() — 1 callers, 6 callees

Verification — 12084 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 11741 function(s) in the blast radius were not formally verified this run

Docs that may be stale (advisory)

…and 10 more.

· 1 grounded finding(s) anchored inline below.

Comment thread src/str_utils.cpp
return quoted;
}

std::string time_format_pattern(const std::string& format, const std::tm& fields) try {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — time_format_pattern()

fans out to 6 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

luisleo526 and others added 4 commits November 2, 2026 20:32
…nd record the new string sites

The formatter's storage failure was thrown by naming the prebuilt object, which the
failure-code scan does not accept as a coded throw. Each of the six sites now
copy-constructs a coded error from that object, so the code (out of memory) and the
message are unchanged and the copy still cannot allocate.

The new std::string sites in src/str_utils.cpp are added to the reviewed source-bounds
manifest with a memory bound read from the code: the output buffer is bounded by a
ceiling derived from the format itself, and the temporaries are per call. The two
entries whose reviewed site no longer exists are retired.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…s real scope

The reviewed site inventory named the growth call on the output buffer in
time_format_chunk with the wrong enclosing-scope ordinal, so the gate reported that
site as new and the declaration of the same buffer as stale. The scope is now the one
the gate derives from the file, which the preflight log of the previous commit printed.
No code and no reading change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ised unreviewed ceiling

The reviewed manifest now carries ten more open entries for the string sites of the
time formatter (the unreviewed ceiling in ci/cr150-source-bounds.yaml went from 1344 to
1354, the gate's designed mechanism for new open entries). The real-tree row of the gate
test pins the exact open count, so its expectation moves from 1344 + 184 to 1354 + 184.
The gate itself reports no finding and no change in its checks.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…istrations moved tests/CMakeLists.txt by

The evidence file pins the cited line of the pooc_close_fill_view_tapes guard in tests/CMakeLists.txt, and the sweep fails when the token no longer sits on that line. The two native test registrations added near the top of the same file moved the guard from line 3422 to 3424, so the cited line, and the line numbers named in the row's reason text, move by two. No other row cites that file; no code and no checker change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@luisleo526
luisleo526 merged commit e9e8f9c into main Nov 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant