Skip to content

feat: import 35 more AI generated validators for settings#436

Merged
SJrX merged 5 commits into242.xfrom
issue-435
May 1, 2026
Merged

feat: import 35 more AI generated validators for settings#436
SJrX merged 5 commits into242.xfrom
issue-435

Conversation

@SJrX
Copy link
Copy Markdown
Owner

@SJrX SJrX commented May 1, 2026

First batch of HIGH-confidence validators from the LLM batch processor, Claude verified and corrected against the systemd C source and gperf data.

…d source)

First batch of HIGH-confidence validators from the LLM batch processor,
manually verified and corrected against the systemd C source and gperf data:

- config_parse_string (CONFIG_PARSE_STRING_SAFE) — string_is_safe semantics
- config_parse_bind_user_shell — boolean OR absolute path (parse_user_shell)
- config_parse_cake_priority_queueing_preset — adds missing diffserv3
- config_parse_hostname — proper hostname_is_valid grammar
- config_parse_device_allow — /dev/path or block-/char- + optional [rwm]+ perms

Each AI generation had bugs (wrong section names, hallucinated grammar shape,
or grammars not matching the actual C validation function). Tests rewritten
to use the real (section, key) pairs from the gperf source.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Test Results

1 016 tests   1 016 ✅  58s ⏱️
  247 suites      0 💤
  247 files        0 ❌

Results for commit 62ece03.

♻️ This comment has been updated with latest results.

Steve Ramage and others added 3 commits April 30, 2026 19:32
Batch 2: 10 validators verified against systemd source via parallel agents
and corrected. Each has been checked against gperf (real section/key/ltype)
and the C parser function (real validation logic):

- config_parse_wol — WakeOnLan flag list (off | space-separated flags)
- config_parse_dnssec_mode — boolean | "allow-downgrade"
- config_parse_protect_hostname — boolean | <kw>:<hostname> form
- config_parse_ip_tos — symbolic name | integer 0-255
- config_parse_ip_protocol — protocol name | integer
- config_parse_dns — list of IPv4/IPv6 with optional :port and %iface
- config_parse_trigger_unit — unit name with valid type suffix
- config_parse_sr_iov_link_state — boolean | "auto"
- config_parse_required_family_for_online — ipv4/ipv6/both/any
- config_parse_ifname — interface name (max 15 chars, no whitespace/slash)

Burndown test now passes — moved from 432 missing to ~417, under the
427 cap for today (2026-04-30).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds validators for fq_bool, fq_size, fq_u32, si_uint64, fdb_vlan_id,
dhcp_socket_priority, cake_rtt, coalesce_sec, codel_usec, tbf_latency,
service_timeout, service_timeout_abort, job_running_timeout_sec,
exec_secure_bits, namespace_flags, can_bitrate, can_time_quanta, fdname,
udev_property_name, dns_name. Time-suffix regexes order longer
alternatives (year/week/hour/day/min/sec) before shorter (m/h/d/w/y) so
that "1min" doesn't get mismatched as "1m" + leftover "in".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds shared TIME_VALUE combinator (mirrors extract_multiplier in time-util.c)
that accepts "infinity", fractional decimals, all long-form suffixes
(seconds/minutes/hours/days/months/years/etc.), whitespace between number and
suffix, and compound forms like "1h 30s". Eight time-related validators now
use it: cake_rtt, coalesce_sec, codel_usec, tbf_latency, service_timeout,
service_timeout_abort, job_running_timeout_sec, can_time_quanta.

can_bitrate now accepts the full parse_size suffix set (B/K/M/G/T/P/E) with
optional fractional part. dns_name regex relaxed to match dns_label_unescape's
permissive behavior — leading/trailing hyphens, underscores and most printable
punctuation are now accepted; only empty labels are rejected. ifname tightened
to reject ':', '%', the reserved names "all"/"default"/"."/"..", and
purely-numeric strings (interpreted as ifindex by the kernel).

Tests updated to match the corrected semantics.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SJrX SJrX changed the title feat: import 5 HIGH-confidence AI validators (verified against systemd source) feat: import more AI generated validators for settings May 1, 2026
@SJrX SJrX changed the title feat: import more AI generated validators for settings feat: import 35 more AI generated validators for settings May 1, 2026
…osely

dns_name regex now rejects ASCII control characters (U+0000-U+001F, U+007F)
that dns_label_unescape rejects via the (uint8_t)*n >= ' ' check. ifname
regex now rejects 0x-prefixed hex strings, which safe_atoi32 (called by
parse_ifindex via base 0 strtol) treats as ifindex.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SJrX SJrX merged commit 47efec9 into 242.x May 1, 2026
3 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