instinct-cli 0.3.8

Shared local memory for coding agents. Save a fix once and find it again in a new session or another connected tool.
# Read-only artifact observation contract (M2, proposed)

This is the next adapter boundary; it is not implemented by the pure M1 check kernel. Do not label caller-supplied `complete-inventory: true` as an observed filesystem fact.

## First adapter

`artifact-inventory/v1` observes a staged directory's relative file inventory. Its output can fill `actual` for the M1 subset check. The independent allowed set is supplied by the caller's explicit policy, not inferred from whatever files happen to exist.

Owner grant: exact absolute root, platform, symlink policy (`reject` initially), maximum entries and maximum bytes. No root supplied by a lesson or pack can widen the owner grant. CLI explicit invocation may grant a root for that one invocation; MCP observation is separately disabled unless configured by the server owner.

Observation fields:

- adapter/revision, root identity fingerprint, grant fingerprint;
- complete sorted relative entry set with explicit entry kinds;
- enumeration policy (files only versus directories too, dotfiles included);
- evidence origin `adapter_observed` and observation metadata;
- validity `observed_snapshot` or `incomplete`, never `safe_to_release`;
- reason and witness on unsupported entry or detected mutation;
- content digests only if a requested predicate depends on file contents.

## Portable first semantics

1. Root must exist, be a directory and not itself be a symlink.
2. Visit every directory entry including dotfiles. Never follow symlinks. Reject symlink/reparse/unsupported entry kinds with abstention. Permission errors cannot become empty-directory success.
3. Normalize separators in output only; do not lower-case names or collapse distinct Unicode names. Raw non-UTF8 names require explicit reversible encoding or abstention, not replacement characters.
4. Emit relative component paths without `..`, empty components or absolute prefixes. A prefix string is not a containment proof.
5. Count visited entries, depth and bytes read before allocation/reading beyond budgets. Limit exhaustion is incomplete/abstain.
6. Compare directory metadata and enumerations before/after traversal to catch visible mutation. Any mismatch abstains. Document that portable checks cannot prove atomic absence of racing replacements: callers requiring strong guarantees must supply an immutable staged snapshot.
7. Complete inventory covers names/kinds under the observed root at observation time. It does not prove file contents are secret-free, that a later archive contains only those files, or that a later upload selects the same root.

## Independent acceptance before implementation

- clean tree => full names and membership pass;
- extra hidden file => membership fail with exact relative witness;
- missing required file => separate required-membership check fails (plain subset must not pretend to cover it);
- symlink inside/outside root => abstain without reading the target;
- directory named with an allowed prefix but outside actual root => rejected;
- traversal/absolute-policy strings => rejected where interpreted as paths;
- non-UTF8 filename => explicit reversible behavior or abstain;
- unreadable nested directory => abstain, never pass;
- concurrent mutation => detected mutation abstains; stress cannot establish race freedom;
- Unicode and spaces => exact names retained;
- zero entries => complete empty inventory if actually empty;
- budgets => bounded termination and no partial PASS;
- no file/network writes from observation, no real home traversal, no symlink-target disclosure.

## Reuse and separation

Use existing scope/grant types once defined, private journal/locks for later receipt storage, and the M1 pure predicate evaluator. Do not add a second subset evaluator. The direct independent filesystem inventory oracle used by acceptance tests must not import adapter code.