Skip to content

fix: source:read, source:page and test judge a path by which house it belongs to - #154

Merged
rodrigoteamx merged 1 commit into
mainfrom
fix/source-read-not-runtime-state
Oct 13, 2026
Merged

rodrigoteamx merged 1 commit into
mainfrom
fix/source-read-not-runtime-state

Conversation

@rodrigoteamx

@rodrigoteamx rodrigoteamx commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

These three operations return a file's content by path and declare no scope, so one rule answers for all of them: which house is this path from, and is it that house's source or its state? — asked case-insensitively, as the house's secret-file rule already is.

  • A copy of the house (a trial, an exercise, a boot candidate under var/) is read like a house of its own: its source is source, its own var//storage/ is state. So an agent can read the source of its own trial copy, while the running house's state stays refused — on every path, including inside a copy.
  • test runs only a test: a .php file or a directory under the house's (or a copy's) tests/, and refuses any other path.

SourcePath::isHouseState gains the copy-aware rule, SourcePath::isTest is added, SourceReadHandler/SourcePageHandler keep calling isHouseState, and TestHandler routes its path through isTest. Tests cover the rule and its spellings (copy source, a copy's own state, a nested copy, letter case, .., links, a directory merely named copy, absolute and /proc paths) and that a real test still runs.

Acta: getmilpa/greenhouse decisions/0618 (D20, D22)

@rodrigoteamx
rodrigoteamx force-pushed the fix/source-read-not-runtime-state branch 2 times, most recently from 72c0896 to de3038c Compare October 13, 2026 02:15
@rodrigoteamx rodrigoteamx changed the title fix: source:read and source:page do not read the house's runtime state fix: source:read, source:page and test judge a path by which house it belongs to Oct 13, 2026
…solves to

These three operations return a file's content by path and declare no scope, so
one rule answers for all of them: which house is this path from, and is it that
house's source, its state, or a test? The rules now identify the file a path
resolves to — by device and inode — rather than matching how the path was
written, so two spellings of one file get one answer.

- A copy of the house (a trial, an exercise, a boot candidate under var/) is
  read like a house of its own: its source is source, its own var/ and storage/
  are state, including inside a copy.
- A read does not hand back a file the house keeps a secret in: the rule the
  house keeps names those files, and it is asked about the file each path
  resolves to; a file whose directory cannot be listed is withheld.
- `test` runs only a test: a .php file or a directory under the house's (or a
  copy's) tests/, and refuses any other path.

SourcePath resolves a path to its stored-name form and SecretFiles asks the
house's secret-file rule over it; SourceReadHandler/SourcePageHandler keep
calling isHouseState, and TestHandler routes its path through isTest. Tests
cover the rule, the copy cases, letter case, a directory, a numeric directory
name, an unlistable directory, and that a real test still runs.
@rodrigoteamx
rodrigoteamx force-pushed the fix/source-read-not-runtime-state branch from 58d4775 to ce84d46 Compare October 13, 2026 15:30
@rodrigoteamx
rodrigoteamx merged commit 3eaec4f into main Oct 13, 2026
2 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