Walden§ docs

Brownfield Adoption

A long-lived Walden portfolio contains different kinds of history: current requirements, superseded product rules, obsolete implementation plans, approvals without fingerprints, and records without execution provenance. An upgrade must preserve those distinctions rather than automatically replaying every historical task.

Establish the current contract

Before requesting execution, review the relevant decision sources within the requested scope:

Proposed applicabilityMeaning and next decision
CurrentBehavior still required by the intended product contract.
SupersededIntentionally replaced or removed; identify the decision and successor before proposing retirement.
MixedSome requirements survive an obsolete design or delivery plan; agree their destination before retiring the old material.
UnresolvedSources conflict or intent is unknown; ask the specific business/scope question.

These are review labels used by the skill, not kernel lifecycle states. Age, absent fingerprints, checked tasks, removed test files, or agreement with today's code do not decide which business rules remain desirable. A newer draft does not automatically replace an approved contract. A case study for improving another product is not authorization to migrate the example repository.

Inspect without execution

walden adopt user-auth --json  # one feature, no proofs or environment probes
walden adopt --json            # explicit whole-portfolio assessment

The read-only plan reports technical classes and per-task evidence assessments:

ClassMeaningWhat an authorized apply would do
backfillRecorded approvals lack fingerprints, or a recorded delivery pass can be sealedSeal eligible current bodies and passes, then re-prove applicable completed work in this scope.
re-proveCompleted work lacks the requested current assurance, or a recorded delivery pass is left unsealedRun its needed proofs through verify. A pass left unsealed may stay as recorded: see Seal recorded delivery passes.
completeNothing to adoptNothing; this is not a claim that every planned task is implemented.
blockedA present contradiction, an upstream approval time recorded before fingerprints that differs from the upstream's, an incompatible plan, or an unreadable ledger prevents adoptionPreserve it and report the specific blocker.

The evidence view separates:

  1. Proof binding: a current complete contract, a reconstructed-equivalent historical contract, a change, contradiction, or missing witness.
  2. Code freshness: whether the recorded and current available code identities agree.
  3. Execution-integrity provenance: known producer/policy facts versus missing or rejected assurance.

A matching full-plan fingerprint can recover assertions omitted from an older task hash, using the current body or locally available Git snapshots. The adapter executes no proof, checks out no source, fetches no history, and rewrites no ledger. Matching argv alone is insufficient. Missing snapshots or unsupported historical syntax remain explicit gaps.

A recovered binding is not a purity attestation. Legacy provenance can remain unknown even when the contract and code match. Such a record is unattested unless another condition takes state precedence; its independent gaps remain visible. A stored passed is historical evidence, not an automatic current guarantee.

evidence status also displays these dimensions but retains diagnostic environment probes. Use adopt when the request requires a probe-free assessment.

Read the workload

Alongside the existing task count, the plan reports declared steps: the command steps in the selected completed tasks. A legacy single-command proof counts as one; shell bodies, nested commands and test selectors are not expanded. Five steps may run many tests, and a failing first step may prevent later steps from running.

Known zero is different from unavailable work. A blocked feature retains its reason, has no numeric workload, and appears in unassessed_features; the totals sum only assessed features:

Assessed workload: 2 task(s), 5 declared step(s); unassessed: blocked-feature

An absent or unapproved task plan contributes no work to the current adoption selection; zero does not mean the product is implemented. Counts are a planning snapshot, not a frozen execution schedule or permission to replay historical work. Planning remains read-only and executes no proofs or environment probes.

Apply only the reviewed scope

walden adopt user-auth --apply
# Or, when the chain is already intact:
walden verify user-auth

Apply is explicitly proof-executing. With no feature selector it applies to the whole present portfolio; do not drop a selector from a reviewed plan or suggested retry. The plan's counts describe work needed for the requested assurance, not proof that every historical task is still a current business obligation.

Approval backfill is a separate trust assumption: an absent seal can be added to a recorded approval's current body, but intervening pre-fingerprint edits cannot be detected. A present contradictory seal needs human reconciliation, never automatic resealing. Backfill cannot establish what a historical proof executed.

The assumption covers the body of a document, not its link. A design or a plan approved before fingerprints records the approval time of the upstream it was reviewed against (source_requirements_approved_at, source_design_approved_at). When that time differs from the upstream's approved_at, the upstream was approved again and the downstream was not reviewed against it: releases before v0.4.0 report that chain as stale. Such a feature is blocked, and nothing in it is sealed. The way out is walden reconcile <feature> and a new approval of its documents.

Apply records actual outcomes through the hardened verify lane. A mutation or unavailable required identity rejects the affected verification and contaminates later executions in that invocation. Restoring source bytes does not revive those failed records; a new valid execution is needed. Assertion outcomes and policy failures remain distinct.

Failures, blocked selections and apply errors produce exit 1, with the per-feature partition retained. Resume by classification after addressing the cause. Do not fix historical failures by weakening a current contract, silently declaring a spec obsolete, or rerunning live deployment/bootstrap work without authorization.

A full strong certificate over a legacy portfolio may still require new executions. Avoiding automatic replay does not manufacture missing facts or exempt unknown features from an unqualified portfolio claim. History lookup has a current-body fast path and per-invocation reuse; its cost depends on available history, while apply costs what the selected proofs cost.

walden adopt warns about a link that is sealed and whose recorded upstream approval time differs from the upstream's. The warning names the feature, the downstream document, both times and the two histories that can have left them, and the plan writes nothing. The class of the feature does not change, and walden status and walden release check keep reading the chain as fresh: the seal binds the content as it is.

Two histories leave that record, and the documents alone do not say which one is theirs:

A repository that never ran walden adopt --apply has only the first history. Otherwise the commit that wrote the fingerprint of the link tells them apart. Search the history of the reported document, a design in the first command and a plan in the second:

git log -p -S'source_requirements_fingerprint: sha256' -- .walden/specs/<feature>/design.md
git log -p -S'source_design_fingerprint: sha256' -- .walden/specs/<feature>/tasks.md

The search prints the commits that added or removed the fingerprint of the link, the most recent first. Read the first one it prints: it wrote the fingerprint the link holds now. An approval sets approved_at in that commit, together with the fingerprint. An adoption adds fingerprints and leaves approved_at as it was. When the history cannot tell, because .walden/ is not committed or the two changes share a commit, treat the review as missing.

Where a review is missing, read the downstream document against its upstream before you approve it again: the new approval is the record of that review. Where nothing is missing, the same steps only make the link record the current approval.

The warning stays until the link records the current approval. Record it with walden review open and walden review approve on the approved documents below the upstream: open them the last one first, approve them again the first one first.

walden adopt                                      # each link is named in the warnings
walden review open <feature> --phase tasks        # the last approved document first
walden review open <feature> --phase design
walden review approve <feature> --phase design    # then approve again, the first one first
walden review approve <feature> --phase tasks

When the reported document is the plan, only the plan is opened and approved. walden reconcile does not help here: it has nothing to repair in a chain that reads fresh.

Seal recorded delivery passes

A plan written before delivery proofs existed often holds proofs that describe a delivery: a version string in a document, a file that a bootstrap task created. They passed when the work shipped and are not expected to pass forever. Once the plan declares such a leaf with - Proof: delivery and is approved again, the pass its record already holds is the fact worth keeping: running the proof again would at best repeat it and at worst replace it with a failure. So walden verify leaves that pass alone unless --task names its task, and adoption can seal it:

walden adopt user-auth          # names each pass it can seal, with its commit
walden adopt user-auth --apply  # seals them, without executing their proofs

Apply seals a pass as an attestation when four checks hold. They run in this order, and the first that fails leaves the pass unsealed with its reason:

ReasonMeaningWhat proves the task again
no-provenanceThe execution provenance of the pass is not supported.Apply, as for any task that is not verified.
proof-changedThe recorded proof differs from the approved one in more than the declaration.Apply, as above.
statements-unknownIt cannot be established that the statements the task names read as they did at the pass.walden verify <feature> --task <id>
no-commitNo commit among the last 200 reachable from HEAD holds the tree the pass ran on.walden verify <feature> --task <id>

The search compares code identities, most recent commit first. The pass need not have run on a committed tree: what counts is that a commit holds exactly the tree it ran on, .walden/ aside, as when the work was committed right after task complete. No commit is found when the tree changed before it was committed, when the history was rewritten or when the commit lies beyond the limit.

Sealing adds the attestation to the record and changes nothing else in it: the result, the steps, the date and the execution facts stay as they were written. The task then reads delivered, marked as sealed by adoption wherever it is reported. Sealing adds no observation of its own. It rests on what the record already says, a pass of that proof on that tree, and nothing shows that the proof would pass today. That is what a delivery proof means, and the reason to declare one only for a fact about what shipped: see Delivery proofs.

The order matters. After declaring a delivery on a completed task, review walden adopt before any walden verify. A pass left unsealed for statements-unknown or no-commit stays as recorded, and only walden verify <feature> --task <id> proves its task again, replacing the pass with what the proof gives now. A pass recorded after the declaration is not adoption's concern: the first walden verify on a tree without uncommitted changes attests it.

Read an apply result

Text mode reports each selected task before its proof starts and its accepted execution or rejection afterward, with measured elapsed time. It keeps the feature name and position, so progress remains attributable even in a large portfolio. JSON mode emits one final envelope, without progress text on stdout.

The final features[].evidence entries retain the verifier's failure diagnostic, assertion/integrity facts and final evidence assessment. Read passed separately from state: an accepted execution can end stale-code after a later mutation, and a passing assertion can be rejected by the integrity policy. The legacy verified counter counts accepted executions, not a new release certificate. Each final state describes that feature's verification boundary; a later feature can still change the repository.

A feature-level reason is not automatically a task-proof failure. If entry was refused, no task execution is invented. If saving the ledger failed after proofs ran, their outcomes remain visible with evidence_persisted: false and the feature error, but are not added to the legacy successful-feature partitions. Do not mistake an in-memory result for saved evidence or rerun a proof just to recover a diagnostic already in the report.

elapsed_ms is measured duration, not an ETA. Task time covers attempted proof steps and runner/timeout cleanup, excluding progress rendering, profile probes and identity capture. Feature time includes processing and saving that feature; invocation time includes planning. Enclosing intervals are measured directly, not summed from nested timings. Zero milliseconds can be a real rounded measurement. Skipped tasks have no new task outcome or duration, even though processing a no-op feature takes time.

There is no automatic log capture or timing history. The ledger does not gain raw output, but an existing verifier diagnostic can contain command output: protect any redirected CLI report accordingly. These additive reporting fields may be absent on older compatible CLIs; absence is not zero or evidence of success.

Format compatibility

New records use ledger schema v1alpha2, with an explicit task-fingerprint scheme and completion/verify provenance. A ledger that holds an attestation is written as v1alpha3. The reader still accepts v1alpha1 and older missing-version ledgers. A new container may hold untouched legacy records; merely loading it or changing its container version does not promote them to trusted evidence.

Older binaries reject v1alpha2, and releases before delivery proofs reject v1alpha3. Use a compatible reader; do not delete or downgrade the ledger to satisfy an older binary. Preserve an unreadable file for diagnosis or restore a justified known-good artifact. Unchanged document approvals and document schema v1alpha1 do not need to change solely for this evidence upgrade.

Retirement

Retirement remains an explicit human decision using Git and .walden/RETIRED.md, not a new kernel state machine:

  1. Confirm the exact superseded scope, reason and successor. A mixed contract needs an agreed home for surviving requirements first.
  2. Verify that every spec/evidence file to be removed is recoverable at a last-live commit. Untracked or ignored local-only history is not preserved merely because the repository uses Git.
  3. Only after authorization and recovery checks, remove the selected feature's spec directory and evidence file, recording name, date, reason, last-live commit and successor in .walden/RETIRED.md.
  4. Commit the ceremony together only when committing is separately authorized and project policy permits it. Never delete history or create an unauthorized commit just to make a gate green.

Missing history or unresolved business intent means stop and ask, not fabricate recovery. The optional walden-history companion can assist; it is not required.

After authorized retirement the default gate judges the remaining on-disk portfolio. An explicitly selected-feature verdict is not a repository-wide certificate. See the daily workflow for checkpoint-based verification and the JSON reference for precise scope and assurance fields.