package manager: record the variables an evaluated manifest read #29
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The variables an evaluation read are printed by
publishand recorded in the lock'sfromsection, which is not written yet.Source
Acceptance criteria
torb publishprints the environment variables the manifest's evaluation readsettingsblock records them infromdocs/tooling/project-lock-trb.mdDependencies
None known.
Moved from the planning lists of the docs; the design record stays the specification.
[loop:torbscript] intake: in scope (author orion, label loop). Records evaluation-read variables in the lock
from/settings block per PROJECT.md "what is left". Changes the lock format, so a breaking and seed-impact check is due in refine. Release freeze for 0.1.0 (2026-10-06) holds new PRs, next: refine (queued)[loop:torbscript] refine: still queued behind the intake order. next: waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z
[loop:torbscript] claim refine by session:loop-torbscript-20261012 until 2026-10-12T15:13Z
fromblock #331[loop:torbscript] decided by the loop: scope, format and hashing.
Scope: variables only, one PR. The issue title and criteria name variables.
filelines offrom { }are filed as a separate follow-up (#331) so this stays one commit of compiler code plus one of docs.Design point: docs/design/PROJECT.md section 8 ("A variable is never recorded by value", the
from { }example, and theunset: trueparagraph) and section 11 ("What is left": nofromsection yet). ROADMAP: package manager.Format (decided):
settings "<pkg>" { ... from { variable "NAME", hash: "sha256:<hex>" ; variable "OTHER", unset: true } },fromlast inside the block, lines sorted by name, block omitted when the evaluation read nothing (so every literal manifest, including the repository's own, renders exactly as today).std/digest, the compiler already uses it for tree hashes) overname + "\n" + value, the same input as the local 64-bit hash ofbuild/manifest-inputs.trb, so two variables with one value do not look alike. The value itself is never written, neither to the lock nor to thepublishoutput.recordgrant reports them (recordedInputs); a manifest that is read statically has none. An unset variable is recorded asunset: true.fromis read unchanged;readLockreads the block into a newManifestfield (default empty). The registry reads settings from the archive's lock and does not act onfrom.torb lockwrites the block as well (it renders the samesettings);torb lock --checkis therefore as environment-dependent as the evaluatedversionalready is for a manifest that reads a variable. Documented in the pitfalls of project-lock-trb.md.torb publishprintsreads: NAME (set)/reads: NAME (unset)per variable before uploading, one line each, sorted; nothing when none.Seed impact: none. No syntax change, no new native, no driver flag, no std name looked up by string;
compiler/src/vm/manifest.trb,compiler/src/project/manifest.trb,compiler/src/package/lock.trb,compiler/src/cli/packages.trband docs only.[loop:torbscript] refine: ready.
Acceptance criteria (replace the issue's list; testable):
evaluatedManifest(compiler/src/cli/packages.trb) answers the variable names (and set/unset state) the sandbox recorded; a manifest read statically answers none.torb publishof a package whoseproject.trbreadsEnvironment.get "X"prints onereads: X (set)orreads: X (unset)line per variable, sorted, and never the value (test with a value that must not appear in stdout).torb lockandtorb publishwritefrom { variable "X", hash: "sha256:...", ... }as the last part of the package'ssettingsblock (unset: truefor an unset one); the hash is SHA-256 ofname\nvalue; a manifest that read nothing renders byte-identically to today.readLockof a lock with afromblock round-trips:renderLock(readLock(text)) == text; a lock withoutfromis read unchanged.docs/tooling/project-lock-trb.md(synopsis, parts table, pitfall on environment-dependence oftorb lock --check) andtorb-publish.mddocument it;docs/design/PROJECT.mdsection 11 "What is left" andROADMAP.mdupdated (nofromsection left for variables; files remain);skills/regenerated.Size: one PR, two Conventional Commits (
feat(package): record the variables a manifest read in the lock+docs(tooling): ...).Seed impact: none (see decision above). Worker: sonnet/medium is enough only if the touched code stays out of checker/IR/VM internals; it does (package/cli/vm manifest glue), so sonnet/medium.
Dependencies: none open. Follow-up for
filelines: filed as #331 (depends on #29).Token usage of this refine worker: about 85k.
[loop:torbscript] claim implement by session:loop-torbscript-20261012 until 2026-10-12T19:16Z
[loop:torbscript] done: PR #337 merged by argus at 2026-10-12T15:14Z, issue closed by the merge. No release or deploy step in the PR; follow-up for
filelines offrom { }stays #331.fromblock #331