ECSS Packet Utilisation — Find Files (space-systems/ecss/e7041-find-files)
Use when the task is the file search of ECSS-E-ST-70-41C clause
6.23.4.4 -- the ground gives a repository and a pattern, the on-board
file management service walks it and reports the files whose names
match, and the reply has to be read for what it does not contain.
Domain quick reference
- The answer is repository path plus file name, never a bare name.
The same name exists in several repositories, so a naked list is
not addressable and the next command against it goes to the wrong
copy.
- A pattern carries two wildcards: one standing for any run of
characters including none, one standing for exactly one character.
Both match within a name and neither crosses a path separator.
- Recursion is a flag, not a pattern effect. No spelling of a pattern
can widen a search into a sub-repository; only the flag does, and it
multiplies both the walk and the number of matches.
- The reply is a telemetry report with a capacity. More matches than
it can carry means a truncated report, and the difference between
"12 files match" and "12 reported of 340" is the difference between
deleting a directory and not.
- The omitted count is the useful number. A truncated report is not
wrong, it is partial, and the count tells the operator whether to
narrow the pattern or walk the sub-repositories one at a time.
- A pattern of nothing but the any-run wildcard was never narrowed.
When such a search truncates, the fix is the pattern, not a bigger
report.
- No match is a third outcome, distinct from a failed search. The
repository was found and walked and held nothing matching; an
unknown repository path never got that far.
- Ordering is part of the contract. Sorting by repository path then
name makes two passes over an unchanged repository comparable, so a
diff between them is a real change rather than a walk order.
Workflow
- Validate the pattern: non-empty, no path separator, within the
name octet cap. Validate stored names as literals -- a wildcard in
a stored name is a corrupt directory entry, not a search.
- Normalise the root repository path and resolve it. Unknown, answer
with the repository failure code rather than an empty match list.
- Build the scope: the root alone, or the root plus every repository
beneath it when recursion is set. Test "beneath" on whole segments
so a sibling sharing a name prefix is not swept in.
- Walk each repository in scope and match each name with a
backtracking wildcard matcher that stays linear over the name.
- Sort the matches by repository path then file name.
- Cut the list at the report capacity, and report the total match
count and the omitted count alongside the entries.
- Categorize the outcome as complete, truncated or no-match, and
mark the report authoritative only when nothing was omitted.
Pitfalls
- Reading a truncated report as the whole answer. Every decision
taken from it is taken on an unknown fraction of the repository.
- Returning names without their repository. The list looks right and
the follow-up command addresses a different file.
- Letting a pattern reach into a sub-repository. Recursion then
happens by accident and the search cost is never budgeted.
- Testing "beneath the root" on a raw string prefix. A sibling whose
name starts with the root's name is searched too.
- Reporting no match and an unknown repository the same way. One is
a clean answer, the other never searched anything.
- Raising the report capacity to clear a truncation. The search was
too wide; a bigger report only moves the wall.
- Leaving the walk order to the underlying storage. Two passes then
differ for no reason and the diff is noise.
Behavior contract (gate 3)
The pattern and name validation, the two wildcards with backtracking,
the segment-wise "beneath the root" test, non-recursive versus
recursive scope, repository-path-bearing entries, deterministic
ordering, the complete, truncated, no-match and unknown-repository
outcomes with the omitted count, and the narrow-the-pattern advice are
exercised by the gate 3 contract test: scripts/test_e7041_find_files.py
against scripts/e7041_find_files_logic.py (stdlib unittest, offline).
Run: python3 scripts/test_e7041_find_files.py
Compliance
- ECSS standards are freely downloadable (ESA); cite the source and
paraphrase per standards-map.yaml.
- compliance: STANDARDS-REF, gated: false.
1---2name: e7041-find-files3description: "Execute a wildcard file search across an on-board repository and judge whether its bounded report can be trusted, under ECSS-E-ST-70-41C clause 6.23.4.4. Use when a search came back with a list and the question is what it left out: matching the any-run and single-character wildcards within a name only, keeping recursion into sub-repositories an explicit flag rather than something a pattern can trigger, returning repository path with every name because one name exists in several repositories, and separating a complete report from one truncated against the report capacity with the omitted count stated. Trigger: ecss, e-st-70-41c, pus-file-management, find-files-request, on-board-file-search-wildcard, recursive-repository-search, truncated-search-report, search-report-capacity."4license: Apache-2.05compliance: STANDARDS-REF6standards:7 - id: ecss8 reference-only: true9gated: false10domain: space-systems11pack: space-systems12compatibility: "agentskills.io SKILL.md; any SKILL.md host (Claude Code, Hermes, OpenClaw)"13metadata:14 source: https://skillmd.com/skills/ashfordeou/e7041-find-files15 domain: space-systems16 subdomain: ecss17 tags: [ecss, e-st-70-41-file-management-scope, e7041-find-files, find-files-request, on-board-file-search-wildcard, recursive-repository-search, truncated-search-report, search-report-capacity]18 version: 0.1.019 author: Aero Agent Skills20---2122# ECSS Packet Utilisation — Find Files (space-systems/ecss/e7041-find-files)2324Use when the task is the file search of ECSS-E-ST-70-41C clause256.23.4.4 -- the ground gives a repository and a pattern, the on-board26file management service walks it and reports the files whose names27match, and the reply has to be read for what it does not contain.2829## Domain quick reference3031- The answer is repository path plus file name, never a bare name.32 The same name exists in several repositories, so a naked list is33 not addressable and the next command against it goes to the wrong34 copy.35- A pattern carries two wildcards: one standing for any run of36 characters including none, one standing for exactly one character.37 Both match within a name and neither crosses a path separator.38- Recursion is a flag, not a pattern effect. No spelling of a pattern39 can widen a search into a sub-repository; only the flag does, and it40 multiplies both the walk and the number of matches.41- The reply is a telemetry report with a capacity. More matches than42 it can carry means a truncated report, and the difference between43 "12 files match" and "12 reported of 340" is the difference between44 deleting a directory and not.45- The omitted count is the useful number. A truncated report is not46 wrong, it is partial, and the count tells the operator whether to47 narrow the pattern or walk the sub-repositories one at a time.48- A pattern of nothing but the any-run wildcard was never narrowed.49 When such a search truncates, the fix is the pattern, not a bigger50 report.51- No match is a third outcome, distinct from a failed search. The52 repository was found and walked and held nothing matching; an53 unknown repository path never got that far.54- Ordering is part of the contract. Sorting by repository path then55 name makes two passes over an unchanged repository comparable, so a56 diff between them is a real change rather than a walk order.5758## Workflow59601. Validate the pattern: non-empty, no path separator, within the61 name octet cap. Validate stored names as literals -- a wildcard in62 a stored name is a corrupt directory entry, not a search.632. Normalise the root repository path and resolve it. Unknown, answer64 with the repository failure code rather than an empty match list.653. Build the scope: the root alone, or the root plus every repository66 beneath it when recursion is set. Test "beneath" on whole segments67 so a sibling sharing a name prefix is not swept in.684. Walk each repository in scope and match each name with a69 backtracking wildcard matcher that stays linear over the name.705. Sort the matches by repository path then file name.716. Cut the list at the report capacity, and report the total match72 count and the omitted count alongside the entries.737. Categorize the outcome as complete, truncated or no-match, and74 mark the report authoritative only when nothing was omitted.7576## Pitfalls7778- Reading a truncated report as the whole answer. Every decision79 taken from it is taken on an unknown fraction of the repository.80- Returning names without their repository. The list looks right and81 the follow-up command addresses a different file.82- Letting a pattern reach into a sub-repository. Recursion then83 happens by accident and the search cost is never budgeted.84- Testing "beneath the root" on a raw string prefix. A sibling whose85 name starts with the root's name is searched too.86- Reporting no match and an unknown repository the same way. One is87 a clean answer, the other never searched anything.88- Raising the report capacity to clear a truncation. The search was89 too wide; a bigger report only moves the wall.90- Leaving the walk order to the underlying storage. Two passes then91 differ for no reason and the diff is noise.9293## Behavior contract (gate 3)9495The pattern and name validation, the two wildcards with backtracking,96the segment-wise "beneath the root" test, non-recursive versus97recursive scope, repository-path-bearing entries, deterministic98ordering, the complete, truncated, no-match and unknown-repository99outcomes with the omitted count, and the narrow-the-pattern advice are100exercised by the gate 3 contract test: scripts/test_e7041_find_files.py101against scripts/e7041_find_files_logic.py (stdlib unittest, offline).102Run: python3 scripts/test_e7041_find_files.py103104## Compliance105106- ECSS standards are freely downloadable (ESA); cite the source and107 paraphrase per standards-map.yaml.108- compliance: STANDARDS-REF, gated: false.