Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions memory-bank/.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,9 @@
"payload_mode": "100644"
},
"memory-bank/features/README.md": {
"ownership": "managed",
"ownership": "adapted",
"base_digest": "sha256:b566792f535872b80432e6c5290a618aac32e3970c63d5f50fc8d8f863a3d312",
"payload_digest": "sha256:b566792f535872b80432e6c5290a618aac32e3970c63d5f50fc8d8f863a3d312",
"base_mode": "100644",
"payload_mode": "100644"
"base_mode": "100644"
},
"memory-bank/flows/README.md": {
"ownership": "managed",
Expand Down
1 change: 1 addition & 0 deletions memory-bank/domain/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ canonical_for:
| Term | Meaning | Context | Do not confuse with |
| --- | --- | --- | --- |
| `domain-term` | Что термин означает в проекте | Где используется | Похожие product, UI или technical terms |
| `task-capsule` | Package-local persisted handoff containing the current route/stage, canonical owner references, resumable actions, assumptions, risks, evidence, stop conditions and the exact next action for safely continuing an active task across sessions, machines or roles. | Feature and Epic orchestration; contract: [`task-capsule.md`](../../template/memory-bank/flows/task-capsule.md) | A lifecycle owner document, a session transcript or a task registry; those may provide facts or projections but do not replace the capsule contract. |

## Naming Rules

Expand Down
19 changes: 19 additions & 0 deletions memory-bank/features/FT-109/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "FT-109: Task Capsule Contract"
doc_kind: feature
doc_function: index
purpose: "Bootstrap-safe navigation for the Task Capsule contract delivery unit."
derived_from:
- ../../../template/memory-bank/flows/feature.md
- brief.md
status: active
audience: humans_and_agents
---

# FT-109: Task Capsule Contract

- [`brief.md`](brief.md) — canonical problem space, scope, profile and verify contract.
- [`design.md`](design.md) — selected storage boundary, schema and ownership mapping.
- [`implementation-plan.md`](implementation-plan.md) — grounded execution and validation plan.
- [`task-capsule.md`](task-capsule.md) — active run state for this feature package.
- [`review-record.md`](review-record.md) — external carrier for bounded review verdicts.
124 changes: 124 additions & 0 deletions memory-bank/features/FT-109/brief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
title: "FT-109: Task Capsule Contract"
doc_kind: feature
doc_function: canonical
purpose: "Define a generic persisted Task Capsule contract that lets Feature and Epic work resume safely without replaying the full transcript."
derived_from:
- ../../../template/memory-bank/flows/feature.md
- ../../../template/memory-bank/flows/task-capsule.md
- ../../../template/memory-bank/flows/routing.md
- ../../../template/memory-bank/engineering/validation-profiles.md
- ../../../template/memory-bank/flows/templates/process/session-handoff.md
status: active
delivery_status: done
audience: humans_and_agents
must_not_define:
- runtime_orchestration
- temporal_integration
- automatic_validation_implementation
---

# FT-109: Task Capsule Contract

## What

### Problem

Feature and Epic flows have canonical documents, but an interrupted session
does not yet have one compact, durable handoff contract that identifies the
current stage, exact next action and evidence without copying those owners.

### Outcome

| Metric ID | Metric | Baseline | Target | Measurement method |
| --- | --- | --- | --- | --- |
| MET-01 | Resume state completeness | No generic capsule contract | All required fields, owners and resume inputs documented | Read-through against issue acceptance and flow owners |

### Scope

- `REQ-01` Document a schema/example containing task identity, route/stage, roles, artifact refs, actions, assumptions, risks, evidence, stop conditions and handoff diagnostic.
- `REQ-02` Define Feature and Epic storage locations, field ownership and lifecycle update rules.
- `REQ-03` Map the capsule to existing Feature/Epic lifecycle documents and session handoff continuation inputs.
- `REQ-04` Preserve canonical owners and state that any registry is projection-only.

### Non-Scope

- `NS-01` Runtime orchestration, Temporal integration, queues, retries or automatic resume.
- `NS-02` Automatic validators or mutations of canonical owner documents.
- `NS-03` Project-specific roles, downstream implementation and parent issue closure.

## Constraints / Assumptions

- `ASM-01` Generic rules belong in `template/memory-bank/`; FT-109 is the project-local delivery owner and evidence package.
- `ASM-02` Existing Feature/Epic lifecycle documents remain canonical for lifecycle facts.
- `CON-01` A capsule must be sufficient to choose one next safe action but must not duplicate requirements, decisions, statuses or registries.

## Design Requirement Decision

| Decision | Reason | Downstream owner |
| --- | --- | --- |
| `Design required: yes` | The issue explicitly requires choosing frontmatter vs dedicated handoff storage and defines a new persisted file-format contract. | [`design.md`](design.md) |

## Artifact Routing Decision

| Artifact | Decision | Trigger / reason | Route / owner |
| --- | --- | --- | --- |
| `design.md` | selected | Storage boundary, schema ownership and lifecycle mapping require solution-space reasoning. | `design.md` |
| `task-capsule.md` | selected | The active feature package needs the same resumable state carrier it defines. | `task-capsule.md` |
| `use-cases/README.md` | omitted | No project-level user scenario changes. | none |

## Validation Profile Decision

| Profile | Triggers / rationale | Downgrade approval |
| --- | --- | --- |
| `documentation` | Only governed Markdown/template documentation changes; no executable behavior, runtime contract, config or release path. Apply link, schema/frontmatter, targeted docs checks and semantic read-through. | none |

## Verify

### Exit Criteria

- `EC-01` A reusable schema/example documents every required field and explicit SSoT boundary.
- `EC-02` Feature and Epic paths, field owners, lifecycle updates and resume inputs are explicit and traceable to their canonical flows.
- `EC-03` Registry projection and all out-of-scope runtime work are explicitly bounded.

### Traceability matrix

| Requirement ID | Problem refs | Acceptance refs | Checks | Evidence IDs |
| --- | --- | --- | --- | --- |
| `REQ-01` | `CON-01` | `EC-01`, `SC-01` | `CHK-01` | `EVID-01` |
| `REQ-02` | `ASM-01`, `ASM-02` | `EC-02`, `SC-02` | `CHK-02` | `EVID-02` |
| `REQ-03` | `ASM-02` | `EC-02`, `SC-03` | `CHK-02` | `EVID-02` |
| `REQ-04` | `CON-01` | `EC-03`, `SC-04` | `CHK-01`, `CHK-02` | `EVID-01`, `EVID-02` |

### Acceptance Scenarios

- `SC-01` A reader can instantiate a capsule and find every required field with a concrete example.
- `SC-02` A reader can identify the Feature and Epic package path and the canonical owner for each field.
- `SC-03` A new session can select the next action from the capsule plus referenced owners and priming inputs, without the prior transcript.
- `SC-04` A registry projection cannot override requirements, lifecycle status or capsule state.

### Checks

| Check ID | Covers | How to check | Expected result | Evidence path |
| --- | --- | --- | --- | --- |
| `CHK-01` | `EC-01`, `EC-03`, `SC-01`, `SC-04` | `rg -n` required keys and SSoT/projection rules in `template/memory-bank/flows/task-capsule.md` | All fields and boundaries are present | `artifacts/ft-109/verify/chk-01/` |
| `CHK-02` | `EC-02`, `SC-02`, `SC-03` | Link/schema lint plus semantic read-through of task-capsule, Feature, Epic and session handoff docs | Links resolve and continuation map is consistent | `artifacts/ft-109/verify/chk-02/` |

### Test matrix

| Check ID | Evidence IDs | Evidence path |
| --- | --- | --- |
| `CHK-01` | `EVID-01` | `artifacts/ft-109/verify/chk-01/` |
| `CHK-02` | `EVID-02` | `artifacts/ft-109/verify/chk-02/` |

### Evidence

- `EVID-01` Required-field and SSoT boundary scan output.
- `EVID-02` Template lint/doctor output and semantic read-through record.

### Evidence contract

| Evidence ID | Artifact | Producer | Path contract | Reused by checks |
| --- | --- | --- | --- | --- |
| `EVID-01` | Required-field scan | verify-runner | `artifacts/ft-109/verify/chk-01/` | `CHK-01` |
| `EVID-02` | Documentation validation and read-through | verify-runner / reviewer | `artifacts/ft-109/verify/chk-02/` | `CHK-02` |
122 changes: 122 additions & 0 deletions memory-bank/features/FT-109/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: "FT-109: Task Capsule Design"
doc_kind: feature
doc_function: canonical
purpose: "Own the selected storage boundary, schema shape and Feature/Epic field ownership for the Task Capsule contract."
derived_from:
- brief.md
- ../../../template/memory-bank/flows/task-capsule.md
- ../../../template/memory-bank/flows/feature.md
- ../../../template/memory-bank/flows/epic.md
- ../../../template/memory-bank/flows/templates/process/session-handoff.md
status: active
audience: humans_and_agents
---

# FT-109: Task Capsule Design

## Design Pack

| Path | Classification | Ownership |
| --- | --- | --- |
| `design.md` | root | selected storage and ownership facts |
| `../../../template/memory-bank/flows/task-capsule.md` | external-dependency | generic contract and reusable schema |
| `../../../template/memory-bank/flows/templates/process/task-capsule.md` | constituent | instantiation template |

## Context

The parent initiative requires durable continuation while existing Feature and
Epic flows already own lifecycle facts. The design must permit a session to
select one safe action without copying those facts into a second active owner.

## C4 Applicability

`C4 not required`: this is a documentation contract and does not add runtime
components or deployment topology. The relevant boundary is documented as
artifact ownership and file references.

## Architecture Coverage Decision

| Aspect | Decision | Rationale |
| --- | --- | --- |
| Components | covered | Feature/Epic package, canonical owners, capsule and optional registry projection are identified. |
| Connectors | covered | Relative links and immutable evidence refs are the only handoff bindings. |
| Configuration | N/A | No runtime/configuration is introduced. |
| Behavioral semantics | covered | Resume, pause, reroute and closure update rules are defined. |
| Quality/evolution concerns | covered | SSoT, revisions, stale refs and projection-only registry rules are explicit. |

## Selected Solution

- `SOL-01` Store one dedicated `task-capsule.md` in each active Feature or Epic package.
- `SOL-02` Keep lifecycle/status/requirements/decisions in existing canonical owners; capsule fields reference owner paths and revisions.
- `SOL-03` Reuse the session-handoff continuation sequence, with a structured schema and one exact `next_action`.
- `SOL-04` Permit a registry/index only as a read/projection view.

## Alternatives Considered

| Alternative | Decision | Reason |
| --- | --- | --- |
| `ALT-01` Put full capsule state in owner frontmatter | rejected | Mixes transient resumable state with canonical lifecycle and makes each owner carry a second contract. |
| `ALT-02` Use only a generic session handoff outside packages | rejected | Loses package ownership and makes Feature/Epic location ambiguous. |
| `ALT-03` Dedicated package-local capsule plus owner refs | selected | Keeps durable continuation local, explicit and non-duplicating. |

## Trade-offs

- `TRD-01` A session reads the capsule and referenced owners, but the schema is durable and machine-readable without requiring a full transcript.
- `TRD-02` Two package types have two paths, but this preserves the existing Feature/Epic ownership boundary and prevents an umbrella registry from owning slice state.

## Accepted Local Decisions

- `SD-01` `task-capsule.md` is the package-local handoff artifact; its frontmatter carries only document metadata and `status`.
- `SD-02` Operational state is a structured body contract; owner documents remain authoritative for lifecycle and requirements.
- `SD-03` Every capsule update leaves exactly one `next_action` and records stale-reference or rejected-handoff diagnostics.

## Contracts

- `CTR-01` Schema keys and ownership rules are canonical in `template/memory-bank/flows/task-capsule.md`.
- `CTR-02` Feature storage is `memory-bank/features/FT-XXX/task-capsule.md`; Epic storage is `memory-bank/epics/EP-XXX/task-capsule.md`.
- `CTR-03` Registry entries are projections and cannot be used to resolve conflicts with capsule or canonical owners.

## Invariants

- `INV-01` One task has one active capsule and one exact next action.
- `INV-02` A capsule never overrides a canonical owner or silently repairs a stale reference.
- `INV-03` Epic slice state is handed off to a separate routed Feature package.

## Failure Modes

- `FM-01` Missing/stale owner ref: pause, re-ground and update the owner or reroute.
- `FM-02` More than one next action: reject handoff and reduce to one sequenced action.
- `FM-03` Registry conflicts with owner: ignore projection and report the canonical owner conflict.

## Rollout / Backout

Not applicable to runtime rollout. Revert the documentation change as one Git
revision; downstream packages continue using their existing owner documents.

## Design Verification

| Analysis class | Required | Method | Result/evidence |
| --- | --- | --- | --- |
| Contract compatibility | yes | Compare schema and ownership with Feature, Epic and session-handoff flow docs. | `EVID-02` |
| State/transition completeness | yes | Trace bootstrap, gate, handoff, pause, reroute and closure updates. | `EVID-02` |
| Failure propagation | yes | Check stale refs, rejected handoff and registry conflict diagnostics. | `EVID-01` |
| Concurrency/ordering | no | No runtime concurrency; single writer and exact-next-action rule are documented. | N/A rationale in `INV-01` |
| Security boundaries | no | No access or auth behavior changes. | N/A |
| Capacity/latency | no | No runtime path. | N/A |
| Migration/evolution safety | yes | Check owner revisions, package-local paths and projection-only registry rule. | `EVID-02` |

## External Dependency Readiness

Existing Feature, Epic and session-handoff documents are active and remain
owners; this design adds links and explicit mapping without changing their
existing lifecycle contracts.

## Traceability

| Requirement | Solution refs | Contract/invariant refs | Evidence |
| --- | --- | --- | --- |
| `REQ-01` | `SOL-01`, `SOL-03` | `CTR-01`, `INV-01` | `EVID-01` |
| `REQ-02` | `SOL-01`, `SOL-02` | `CTR-02`, `INV-02` | `EVID-02` |
| `REQ-03` | `SOL-02`, `SOL-03` | `CTR-01`, `INV-03` | `EVID-02` |
| `REQ-04` | `SOL-04` | `CTR-03`, `FM-03` | `EVID-01` |
Loading