Skip to content

Feat/validators unit core - #554

Closed
SJrX wants to merge 8 commits into
242.xfrom
feat/validators-unit-core
Closed

SJrX wants to merge 8 commits into
242.xfrom
feat/validators-unit-core

Conversation

@SJrX

@SJrX SJrX commented Oct 24, 2026

Copy link
Copy Markdown
Owner

No description provided.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Unit Test Results (grammar engine false)

1 389 tests   1 389 ✅  1m 2s ⏱️
  350 suites      0 💤
  350 files        0 ❌

Results for commit 65e58aa.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Unit Test Results (grammar engine true)

1 389 tests   1 389 ✅  1m 7s ⏱️
  350 suites      0 💤
  350 files        0 ❌

Results for commit 65e58aa.

♻️ This comment has been updated with latest results.

@sjrx-claude-sandbox
sjrx-claude-sandbox force-pushed the feat/validators-unit-core branch 3 times, most recently from 7179c76 to 5258f53 Compare October 24, 2026 17:11
SJrX and others added 8 commits October 24, 2026 11:24
…mers (unit-core batch)

Models calendar_spec_from_string and parse_sec as structural grammars
(shared in BatchUnitCoreCombinators.kt), with a unit-specifier escape
hatch for values that use %-specifiers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
SOCKET_SOCKET is shared by ListenStream/Datagram/SequentialPacket/Netlink,
which config_parse_socket_listen tells apart by key name, so that validator
dispatches on the key. The file ltypes follow path_simplify_and_warn,
with ListenSpecial= exempt from the API VFS check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…it-core batch)

Covers PIDFile=, BusName=, OpenFile=, RefreshOnReload=, JobTimeoutSec=,
the obsolete Requires/RequisiteOverridable= (forwarded to the unit
dependency validator, as the C parser does), and the generic
config_parse_path, config_parse_long and config_parse_iec_size_long.

Also namespaces the batch's shared grammar in BatchUnitCoreGrammar and
anchors semantic regexes to the end of their token, which the classic
engine needs to localise errors without overrunning the value.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…guessed anchors

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- RefreshOnReload=: accept booleans in any case (parse_boolean uses
  STRCASE_IN_SET) via a batch-local case-insensitive boolean terminal.
- OnCalendar=: only accept a plausible timezone in the zone position
  (UTC any case, known zone IDs, tzdata Area/ names, host-style
  abbreviations that are not weekdays/keywords, numeric offsets), and
  require exactly one space before it except after a bare weekday list
  or date. Accept "@+5" / "@ 5" (strtoul). Spell the optional weekday
  prefix as separate branches to avoid a classic-engine crash.
- safe_atou numbers: accept "-0" (ERANGE only for non-zero values).
- OpenFile=: accept one trailing ':' after the options field.
- Listen*= AF_UNIX: allow 4 extra characters for /var/run/ paths,
  which patch_var_run() shortens before the length check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OpenFile= now refuses a repeated flag and more than one of
read-only/append/truncate, as open_file_parse/open_file_validate do
(found by the systemd oracle check on the kf6 corpus value). The other
oracle mismatches for this family are harness or host-timezone artifacts;
the tests now record the sd-check evidence.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tors

242.x's BOOLEAN now ignores case like parse_boolean(), so the batch-local
BOOLEAN_ANY_CASE copy is redundant. RefreshOnReload= uses BOOLEAN directly
and its tests gain more mixed-case booleans and mixed-case resource names
(the table lookup is streq, so those stay invalid).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replace BatchUnitCoreGrammar.SafeAtoNumberTerminal and safeAtou with the
shared SafeAtoTerminal, written out at each call site:

- ListenStream=/ListenDatagram= ports: parse_ip_port, so
  REFUSE_LEADING_WHITESPACE and 1..65535.
- vsock CID and port: safe_atou on a field cut at ':', whitespace allowed.
- ListenNetlink= family: a whitespace-split word (0..INT_MAX); the group is
  the rest of the value handed to safe_atou, so whitespace reaches it. The
  family/group separator is now C's " \t\n\r" only.
- MessageQueueMaxMessages= (config_parse_long): signed, INT64 bounds.

Verdicts now matching sd-check at 0f0682b773: accepted 0b+1, 0b 1, 0o 7,
0b +1, \v80 and 1.2.3.4:0b 1 as ports, vsock:2: 80, vsock: 2:80,
ListenNetlink=route 0b 1, route \v5, 0b+1 5, and
MessageQueueMaxMessages=0b-1, 0o-7, 0b -1, 0b+1, 0b 1, \v5, \v-1; flagged
ListenNetlink=route\v5.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SJrX SJrX closed this Oct 24, 2026
@SJrX
SJrX deleted the feat/validators-unit-core branch October 24, 2026 20:38
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