Skip to content

Allow a field accessor alongside FILES' :all()/:groups() GROUP-mode pointer - #274

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

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

Conversation

@dk107dk

@dk107dk dk107dk commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

$acme.files.:all().:last():uuid() and $mixed.files.:groups().:last():uuid()
now resolve to one field value per (named-file, path) group, instead of
raising.

Background

The bucket-list entry read as a single, still-open question -- "GROUP
modes combined with :manifest()/a field-accessor... not yet built for
FILES." Traced query()'s own GROUP-mode rejection and the reduction
logic just below it before touching anything, rather than assuming the
whole thing needed new machinery:

  • The reduction logic (if pointers: if partitioned: ...) already
    independently reduces each distinct file_home's own candidates via
    the pointer, unconditionally -- nothing about it depends on whether
    :manifest()/a field accessor is also present.
    ReferenceResults3.ambiguous_content_read was already correctly
    written to flag only has_manifest, never has_field_function -- the
    Rule-1-vs-Rule-3 (whole-resource vs. poolable-field) distinction this
    fix depends on already existed, just wasn't consistently applied.
  • The rejection's own comment claimed it "mirrors"
    ResultsReferenceFinder3's own :all()-grouping restriction -- but
    that was citing RESULTS' original, since-superseded blanket
    rejection. RESULTS' current _star_group_and_reduce() already allows a
    field accessor through here (e.g. ":all():last().invoices:uuid()"
    resolves fine there, confirmed live before that code was even
    written), only rejecting a whole-resource content accessor. FILES had
    simply never been updated to match -- a real, confirmable staleness,
    not a guess.
  • _extract_data() needed no changes at all -- :all()/:groups()
    bare occupies name_one's entire content by construction, so the
    trailing field accessor has nowhere to land except name_three, the
    same already-tested extraction path every other name_three field
    accessor already uses.

What changed

Narrowed query()'s GROUP-mode rejection from pointers and (has_manifest or has_field_function) to pointers and has_manifest --
:manifest() (whole-resource) stays rejected here, unchanged, for the
same Rule-1 reasoning it always had; a field accessor is no longer caught
by the same check. That is the entire fix.

Deliberately out of scope: '*'-traversal's own, separate and much
broader field-accessor rejection in _query_star_traversal() -- a
bigger, still-open gap, unrelated to this fix's partitioned-plus-
pointers scope. Confirmed its own existing tests still pass unchanged.

Test plan

  • Converted the two existing tests that asserted the old rejection
    into positive assertions -- one correct uuid per group, for both
    :all() (ALPHA_MANIFEST's two file_home groups) and :groups()
    (MIXED_MANIFEST's two different-depth groups).
  • Their :manifest()-combined sibling tests (asserting the
    still-correct rejection) left unchanged.
  • tests/references/ full tree: 1560 passed.
  • Full suite run twice for stability: 3153 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

…ointer

$acme.files.:all().:last():uuid() and $mixed.files.:groups().:last():uuid()
now resolve to one field value per (named-file, path) group, instead of
raising.

The rejection blocking this lumped :manifest() (whole-resource, still
Rule 1 territory) together with any field accessor (poolable, exempt
from Rule 1 everywhere else in this file). The reduction logic just
below the rejection already independently reduces each file_home's own
candidates via the pointer regardless of which accessor rides alongside
it, and ambiguous_content_read was already correctly written to flag
only has_manifest -- the rejection was the one place still treating the
two the same.

The old comment claimed this "mirrors" ResultsReferenceFinder3's own
:all()-grouping restriction, but that was citing RESULTS' original,
since-superseded blanket rejection -- RESULTS' current
_star_group_and_reduce() already allows a field accessor through here,
only rejecting a whole-resource content accessor. FILES had simply never
been updated to match.

_extract_data() needed no changes: :all()/:groups() bare occupies
name_one's entire content by construction, so the trailing field
accessor has nowhere to land except name_three, the same
already-tested extraction path every other name_three field accessor
already uses.

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