feat!: installation only from a release, into an empty folder; upstream merge/verify and private-instance.md removed, dist adopt, shell-neutral instructions (#153)
CI / verify (push) Successful in 5m19s
CI / pwsh (push) Successful in 1m55s
Release / release (push) Successful in 36s

Files changed:
- .gitea/workflows/ci.yml
- .gitea/workflows/release.yml
- AGENTS.md
- CHANGES.md
- DEVELOPMENT.md
- EVALS.md
- INSTALL.md
- README.md
- VERSION
- docs/ownership-and-templates.md
- instructions/CONTRACT.md
- instructions/bootstrap.md
- instructions/dev/dev-setup.md
- instructions/dev/stack-dev/SKILL.md
- instructions/gates.md
- instructions/ingest-large-tree.md
- instructions/kb-profiles.md
- instructions/mcp-read-server.md
- instructions/migrations/3.0.0-authoring-conventions.md
- instructions/preflight.md
- instructions/private-instance.md
- instructions/session-setup.md
- instructions/setup-instance.md
- instructions/upgrade-instance.md
- tools/CONTRACT.md
- tools/README.md
- tools/chemenu/cli.py
- tools/chemenu/cli_contract.py
- tools/chemenu/commands/dist_cmd.py
- tools/chemenu/commands/docs_verify.py
- tools/chemenu/commands/doctor.py
- tools/chemenu/commands/git_publish.py
- tools/chemenu/commands/upstream_cmd.py
- tools/chemenu/commands/work_cmd.py
- tools/chemenu/config.py
- tools/chemenu/ownership.py
- tools/chemenu/tests/test_cli.py
- tools/chemenu/tests/test_dist_cmd.py
- tools/chemenu/tests/test_instructions_shell.py
- tools/chemenu/tests/test_preflight.py
- tools/chemenu/tests/test_preflight_pwsh.py
- tools/chemenu/tests/test_run_budget.py
- tools/chemenu/tests/test_upstream_cmd.py
- tools/chemenu/toc.py
- tools/preflight.ps1
- tools/preflight.sh
This commit is contained in:
torben committed 2026-10-01 22:12:09 +02:00
1 parent d0f08d1fba
commit a6d07f97c4
46 files changed
+1314 -1936

No files matched your search

+36 -15
View File
@@ -1,7 +1,7 @@
---
type: types/instruction.md
name: session-setup
description: Scope the wikitool iteration budget to the task by exporting a stable session id before the first tool call.
description: Scope the wikitool iteration budget to the task by setting a stable session id - one line for bash, one for PowerShell - before the first tool call.
---
# Scope the session budget
@@ -15,17 +15,39 @@ Without an explicit id, and on a harness with no registered variable, the budget
whichever shell happened to run the command, so a task spanning several terminals is counted as
several sessions - and one that reuses a shell inherits an unrelated count.
<!-- wikitool:toc -->
## Contents
- [Steps](#steps)
- [Multi-unit runs](#multi-unit-runs)
- [Scope](#scope)
<!-- /wikitool:toc -->
## Steps
Run this **once per working session**, before the first `wikitool` call that is not exempt from
the budget (see § Scope for what that means):
the budget (see § Scope for what that means). Pick the id yourself - a short name for the task and
the current date and time, such as `wiki-20261001-1430` - and set it with the line for the shell
you run in. In a POSIX shell (Linux, macOS, Git Bash on Windows):
```bash
export WIKITOOL_SESSION_ID="wiki-20261001-1430"
```
In PowerShell 7:
```powershell
$env:WIKITOOL_SESSION_ID = 'wiki-20261001-1430'
```
These two lines are the only shell-specific syntax in the stack's instructions; everything else is
a `tools/wikitool` or `git` call that reads the same in both shells. Then:
```bash
export WIKITOOL_SESSION_ID="wiki-$(date +%s)"
tools/wikitool sync
```
**An `export` only carries if the shell carries.** Several agent harnesses run every tool call in
**The variable only carries if the shell carries.** Several agent harnesses run every tool call in
a freshly initialised shell: the working directory survives, shell state - environment variables,
functions - does not, so the variable is gone by the next call and each call falls back to whatever
the chain's next step resolves to.
@@ -37,13 +59,15 @@ work into the same count. Setting `WIKITOOL_SESSION_ID` explicitly still narrows
task at hand, and remains the only way to scope it at all on a harness with no registered
variable - each call falls back to its own parent pid there, and neither the 60-call ceiling nor
the loop-breaker can ever trip (measured directly on a real upgrade run: 33 `wikitool` calls in
one task split into 21 telemetry buckets under the pid fallback alone). On such a harness, pass
the id **inline on every call** instead of `export`, keeping the same value for the whole task:
one task split into 21 telemetry buckets under the pid fallback alone). On such a harness, put the
line **in front of every `tools/wikitool` call, in the same command**, joined with `;` - which
both shells read the same way - and keep the same value for the whole task.
```bash
WIKITOOL_SESSION_ID="wiki-1234" tools/wikitool sync
WIKITOOL_SESSION_ID="wiki-1234" tools/wikitool new entity --name "..."
```
**GitHub Copilot registers no variable.** Neither Copilot CLI nor Copilot's agent mode in VS Code
sets a session variable in the shell it runs commands in (checked against their documentation,
October 2026), so the chain has no second step there. Under Copilot the line above is what scopes
the budget at all, and what `tools/wikitool doctor` reads: without it, `doctor` reports
`session-id: WARN` and names the parent-pid fallback.
Which of the three applies is answerable in one call: run `tools/wikitool budget status` twice in
separate calls, and see whether it names the same id both times, and where that id came from -
@@ -70,10 +94,7 @@ user, then `tools/wikitool sync --confirm-rebase <token>` before continuing. See
A task planned as several units - a tree ingest, where each unit produces its own source page
and its own `publish` - takes one id per unit, derived from the workshop's run key:
```bash
export WIKITOOL_SESSION_ID="ingest-documents-handbook/u3"
```
`<runkey>/u<N>`, for instance `ingest-documents-handbook/u3`, set with the same line as above.
The run key, the workshop directory name and the session id are then the same string, so the
checklist in `work/<runkey>/README.md` and the budget state cannot disagree about where the
@@ -87,7 +108,7 @@ refusal. See [gates.md](gates.md).
**The exemption is an allowlist, not "read-only" or "does not change the wiki."** A command
needs this setup unless it is one of the dozen `tools/CONTRACT.md` marks exempt in its command
table (`search`, `doctor`, `links show`, `cite id`, `budget status`, the read-only forms of
`eval`, `version`, `migrate` and `upstream verify`) - that table, not a rule of thumb here, is
`eval`, `version` and `migrate`) - that table, not a rule of thumb here, is
the single list. One entry on it, `version regrade`, is exempt only in its bare listing form and
counted when it is given positions to regrade; every other entry is exempt however it is called.