Skip to content

Support bare :manifest() + chained field accessor for FILES - #272

Merged
dk107dk merged 1 commit into
mainfrom
feature/files-manifest-field-accessor
Aug 29, 2026
Merged

dk107dk merged 1 commit into
mainfrom
feature/files-manifest-field-accessor

Conversation

@dk107dk

@dk107dk dk107dk commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

$acme.files.:manifest():uuid() and $*.files.:manifest():uuid() now
work, literal-root and '*' alike -- driven directly by David's own
worked examples ("get uuids from all registrations," "get all acme
registration uuids"), meant to combine with SUBTRACT/INTERSECT
against another reference expression.

Background

Neither form worked before this PR. The first framing of the gap was
"does this need a . before the field accessor" -- traced live (parsing
both forms) and by code-reading before answering, since that turned out
to be the wrong axis. :first():fingerprint() (pointer + field accessor,
no dot, order-independent) already works today, but only because it
reads a field off exactly ONE already-selected entity. Bare :manifest()
does not select one entity -- it means "every entry in the manifest"
(Rule 1a/1b's own territory). Chaining a field accessor onto THAT asks
for something no code path did before: mapping a field over MANY entities
at once, regardless of dot placement.

Reference3.resolve_kind already classified this shape correctly as
METADATA_FIELD (confirmed live via terminal_functions), so the actual
gap was narrower than it first looked: query() needed to produce N
results instead of raising, and _extract_data() needed to read a field
per result instead of assuming exactly one.

What changed

  • FilesReferenceFinder3._bare_manifest_field_call(name_one) -- new
    shared recognition helper: "name_one's path is a single, argument-less
    :manifest() call, with exactly one chained field-accessor function."
    Reused identically by query(), _query_star_traversal(), and
    _extract_data().
  • query() (literal root): new branch reading the named-file's own
    get_manifest(), one ReferenceResult3 per entry.
  • _query_star_traversal(): new branch reading
    files_root_manifest (the global arrivals ledger, Rule 1a's own
    resource) -- confirmed its entries use different key names than
    per-name manifest entries ("file_path"/"named_file_name", not
    "file") by reading FilesListener._prep_update() directly, rather
    than assuming the two manifests share a shape. Composes with
    :regex()-at-root_major.
  • _extract_data(): widened the METADATA_FIELD field-lookup to also
    try the new helper, and to read from files_root_manifest instead of
    get_manifest(root_major) when root_major is the '*' token (not a
    real name).
  • resolve()/resolve_from(): no changes needed -- confirmed by
    reading them first that the existing per-result _extract_data() loop
    already turns N results into N resolved values for free.

The pre-existing :name(...)+pointer, then :uuid() in name_three
pattern (narrow to one version, then read its field) is untouched and
stays equally valid -- David's own explicit confirmation, covered by a
dedicated test.

Deliberately not built: :all()/:flatten()/:groups() combined with a
chained field accessor -- partitioning semantics differ per marker, a
distinct question left on the bucket list.

Test plan

  • TestBareManifestFieldAccessor (8 cases, literal root): one result
    per entry, resolved values (not whole entries), David's own exact
    syntax, a second field (:time()) to prove genericity, name_three
    rejection, more-than-one-chained-function rejection, non-field-
    accessor rejection, pre-existing name_three pattern unaffected.
  • TestStarBareManifestFieldAccessor (4 cases, '*' root): same
    shape against a dedicated ledger fixture with the real
    "file_path"/"named_file_name" keys, :regex() composition,
    name_three rejection.
  • tests/references/ full tree: 1555 passed.
  • Full suite run twice for stability: 3148 passed, 11 failed both
    times (identical) -- the known, unrelated SFTP/S3 failures
    requiring unset env vars (issue test_nos_server_config_1 crashes with a raw ValueError when SFTP_* env vars are unset, instead of failing clearly #216).

https://claude.ai/code/session_013gPjejPWvbWtjz2dw9h14M

…ILES

$acme.files.:manifest():uuid() and $*.files.:manifest():uuid() now work,
literal-root and '*' alike -- driven by David's own worked examples
("get uuids from all registrations," "get all acme registration uuids").

Bare :manifest() means "every entry in the manifest" (Rule 1a/1b's own
territory), not one selected entity, so chaining a field accessor onto
it maps that field over every entry rather than reading it off a single
already-picked one. That's different in kind from the existing
:first():fingerprint()-style position (pointer + field accessor, no dot,
order-independent), which only ever reads a field off exactly one
selected entity -- confirmed via code tracing that neither dot placement
nor argument order was the actual blocker; the real gap was that no code
path mapped a field over many entities at once.

query() now recognizes this shape (a new
FilesReferenceFinder3._bare_manifest_field_call() helper, shared by
query(), _query_star_traversal(), and _extract_data()) and produces one
ReferenceResult3 per manifest entry -- the named-file's own manifest.json
for a literal root, the global arrivals ledger for '*'. No changes were
needed in resolve()/resolve_from(): their existing per-result
_extract_data() loop already turns N results into N resolved values for
free.

The pre-existing :name(...)+pointer, then :uuid() in name_three pattern
(narrow to one version, then read its field) is untouched and stays
equally valid, per David's own confirmation -- covered by a dedicated
test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gPjejPWvbWtjz2dw9h14M
@dk107dk
dk107dk merged commit b1d34c9 into main Aug 29, 2026
@dk107dk
dk107dk deleted the feature/files-manifest-field-accessor branch August 29, 2026 02:47
dk107dk pushed a commit that referenced this pull request Aug 29, 2026
David's own worked examples, now confirmed working end-to-end (#272,
#273): getting uuids from all/one named-file's registrations, and
combining them with SUBTRACT/INTERSECT against a RESULTS-side reference.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gPjejPWvbWtjz2dw9h14M
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