Compare commits
41
Commits
main
...
3fad49d6b9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fad49d6b9 | ||
|
|
ef55f9ac0a | ||
|
|
544b9c78d3 | ||
|
|
0e92111661 | ||
|
|
f88e9ba43c | ||
|
|
9ba3076fa8 | ||
|
|
2e428cf8e6 | ||
|
|
1212c562d2 | ||
|
|
5f6169c06c | ||
|
|
886d4b8bc2 | ||
|
|
389c159681 | ||
|
|
ac6c55809f | ||
|
|
e9e1ce576c | ||
|
|
6656280b2c | ||
|
|
e9ce6d0afa | ||
|
|
b159899d73 | ||
|
|
47ffb2d10b | ||
|
|
24a51744f5 | ||
|
|
f1ecb74dc4 | ||
|
|
02228a2847 | ||
|
|
1217da5f5e | ||
|
|
ae9f60fe1f | ||
|
|
64d5c6746e | ||
|
|
573220e12a | ||
|
|
0b85edfdea | ||
|
|
b9d28d190e | ||
|
|
b568fcf9c9 | ||
|
|
ecb4827e75 | ||
|
|
f2242eb39d | ||
|
|
431b82fd43 | ||
|
|
045d631c12 | ||
|
|
adb29a2afc | ||
|
|
a55bc716c4 | ||
|
|
fe2693870e | ||
|
|
c55fb1b998 | ||
|
|
34741dc2d2 | ||
|
|
b152b6e07e | ||
|
|
64fdaa03f2 | ||
|
|
d9bcc7324b | ||
|
|
540fcb35ba | ||
|
|
1210dd899c |
@@ -0,0 +1,181 @@
|
||||
---
|
||||
name: "OPSX: Apply"
|
||||
description: "Implement tasks from an OpenSpec change (Experimental)"
|
||||
allowed-tools: Bash(openspec:*)
|
||||
category: "Workflow"
|
||||
tags: ["workflow", "artifacts", "experimental"]
|
||||
---
|
||||
|
||||
Implement tasks from an OpenSpec change.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
||||
|
||||
2. **Check status to understand the schema**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
Parse the JSON to understand:
|
||||
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
||||
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
|
||||
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
||||
|
||||
3. **Get apply instructions**
|
||||
|
||||
```bash
|
||||
openspec instructions apply --change "<name>" --json
|
||||
```
|
||||
|
||||
This returns:
|
||||
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
||||
- Progress (total, complete, remaining)
|
||||
- Task list with status
|
||||
- Dynamic instruction based on current state
|
||||
- Optional `context`: current required project instruction input from the selected root
|
||||
- Optional `operationGuidance`: current advisory guidance for apply
|
||||
|
||||
**Handle states:**
|
||||
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` (if it is not installed, run `openspec status --change "<name>" --json` to see the next artifact and `openspec instructions <artifact-id> --change "<name>" --json` for how to create it)
|
||||
- If `state: "all_done"`: congratulate, suggest archive
|
||||
- Otherwise: proceed to implementation
|
||||
|
||||
Treat `context` as a required prompt-level input. Read and consider it, and
|
||||
apply relevant project facts, conventions, and constraints while implementing.
|
||||
Treat `operationGuidance` as optional additive advice. Read and consider every
|
||||
entry, and follow entries that are applicable and compatible with the built-in
|
||||
workflow.
|
||||
|
||||
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
|
||||
progress, `contextFiles`, and the built-in `instruction`. They are not
|
||||
evidence of task completion, do not replace the built-in instruction, and do
|
||||
not permit bypassing a blocked state. If context conflicts with the built-in
|
||||
instruction, an explicit user choice, or a CLI-controlled value, report the
|
||||
conflict and preserve the controlling value. If guidance is inapplicable or
|
||||
conflicts with those controlling inputs, do not follow it and explain why.
|
||||
These are prompt-level behavior contracts, not enforceable checks.
|
||||
|
||||
4. **Read context files**
|
||||
|
||||
Read every file path listed under `contextFiles` from the apply instructions output.
|
||||
The files depend on the schema being used:
|
||||
- **spec-driven**: proposal, specs, design, tasks
|
||||
- Other schemas: follow the contextFiles from CLI output
|
||||
|
||||
Do not copy `context` or `operationGuidance` verbatim into implementation
|
||||
files or planning artifacts unless the user separately asks for that content.
|
||||
|
||||
5. **Show current progress**
|
||||
|
||||
Display:
|
||||
- Schema being used
|
||||
- Progress: "N/M tasks complete"
|
||||
- Remaining tasks overview
|
||||
- Dynamic instruction from CLI
|
||||
|
||||
6. **Implement tasks (loop until done or blocked)**
|
||||
|
||||
For each pending task:
|
||||
- Show which task is being worked on
|
||||
- Make the code changes required
|
||||
- Keep changes minimal and focused
|
||||
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
||||
- Continue to next task
|
||||
|
||||
**Pause if:**
|
||||
- Task is unclear → ask for clarification
|
||||
- Implementation reveals a design issue → suggest updating artifacts
|
||||
- Error or blocker encountered → report and wait for guidance
|
||||
- User interrupts
|
||||
|
||||
7. **On completion or pause, show status**
|
||||
|
||||
Display:
|
||||
- Tasks completed this session
|
||||
- Overall progress: "N/M tasks complete"
|
||||
- If all done: suggest archive
|
||||
- If paused: explain why and wait for guidance
|
||||
|
||||
**Output During Implementation**
|
||||
|
||||
```
|
||||
## Implementing: <change-name> (schema: <schema-name>)
|
||||
|
||||
Working on task 3/7: <task description>
|
||||
[...implementation happening...]
|
||||
✓ Task complete
|
||||
|
||||
Working on task 4/7: <task description>
|
||||
[...implementation happening...]
|
||||
✓ Task complete
|
||||
```
|
||||
|
||||
**Output On Completion**
|
||||
|
||||
```
|
||||
## Implementation Complete
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Progress:** 7/7 tasks complete ✓
|
||||
|
||||
### Completed This Session
|
||||
- [x] Task 1
|
||||
- [x] Task 2
|
||||
...
|
||||
|
||||
All tasks complete! You can archive this change with `/opsx:archive`.
|
||||
```
|
||||
|
||||
**Output On Pause (Issue Encountered)**
|
||||
|
||||
```
|
||||
## Implementation Paused
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Progress:** 4/7 tasks complete
|
||||
|
||||
### Issue Encountered
|
||||
<description of the issue>
|
||||
|
||||
**Options:**
|
||||
1. <option 1>
|
||||
2. <option 2>
|
||||
3. Other approach
|
||||
|
||||
What would you like to do?
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
- Keep going through tasks until done or blocked
|
||||
- Always read context files before starting (from the apply instructions output)
|
||||
- If task is ambiguous, pause and ask before implementing
|
||||
- If implementation reveals issues, pause and suggest artifact updates
|
||||
- Keep code changes minimal and scoped to each task
|
||||
- Update task checkbox immediately after completing each task
|
||||
- Pause on errors, blockers, or unclear requirements - don't guess
|
||||
- Use contextFiles from CLI output, don't assume specific file names
|
||||
- Do not use context or operation guidance as proof that a task is complete
|
||||
- Apply relevant project context; report conflicts with controlling workflow inputs
|
||||
- Consider every guidance entry; explain any inapplicable or conflicting advice
|
||||
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
|
||||
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
|
||||
|
||||
**Fluid Workflow Integration**
|
||||
|
||||
This skill supports the "actions on a change" model:
|
||||
|
||||
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
||||
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
||||
@@ -0,0 +1,225 @@
|
||||
---
|
||||
name: "OPSX: Archive"
|
||||
description: "Archive a completed change in the experimental workflow"
|
||||
allowed-tools: Bash(openspec:*)
|
||||
category: "Workflow"
|
||||
tags: ["workflow", "archive", "experimental"]
|
||||
---
|
||||
|
||||
Archive a completed change in the experimental workflow.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
||||
|
||||
**Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
||||
|
||||
When prompting, show only active changes (not already archived).
|
||||
Include the schema used for each change if available.
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:archive <other>`).
|
||||
|
||||
**Load current archive inputs before the existing archive checks:**
|
||||
|
||||
After resolving the selected change and planning root, run:
|
||||
```bash
|
||||
openspec instructions archive --change "<name>" --json
|
||||
```
|
||||
Keep the same selected-root flags on this command. This lookup is advisory and
|
||||
optional: it only supplies extra prompt inputs, so it must never block archiving.
|
||||
If it exits non-zero or returns invalid JSON — for example on an older CLI that
|
||||
does not support this command yet — continue the archive workflow with no
|
||||
context and no operation guidance. Do not report an error and do not stop.
|
||||
|
||||
A successful response may omit both optional fields. Treat `context` as a
|
||||
required prompt-level input: read and consider it, and apply relevant project
|
||||
facts, conventions, and constraints. Treat `operationGuidance` as optional
|
||||
additive advice: read and consider every entry, and follow entries that are
|
||||
applicable and compatible with the built-in archive workflow.
|
||||
|
||||
Keep both fields separate from built-in steps, explicit user choices, resolved
|
||||
paths, CLI checks, and command contracts. If context conflicts with one of those
|
||||
controlling inputs, report the conflict and preserve the controlling value. If
|
||||
guidance is inapplicable or conflicts with a controlling input, do not follow it
|
||||
and explain why. Do not infer replacement paths, skipped prompts, or flags from
|
||||
either field, and do not copy their text verbatim into specs, change artifacts,
|
||||
or archive summaries unless the user separately asks for it. These are
|
||||
prompt-level behavior contracts, not enforceable checks.
|
||||
|
||||
2. **Check artifact completion status**
|
||||
|
||||
Run `openspec status --change "<name>" --json` to check artifact completion.
|
||||
|
||||
Parse the JSON to understand:
|
||||
- `schemaName`: The workflow being used
|
||||
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
||||
- `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
|
||||
|
||||
**If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
|
||||
- Display warning listing incomplete artifacts
|
||||
- Prompt user for confirmation to continue
|
||||
- Proceed if user confirms
|
||||
|
||||
3. **Check task completion status**
|
||||
|
||||
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
||||
|
||||
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
||||
|
||||
**If incomplete tasks found:**
|
||||
- Display warning showing count of incomplete tasks
|
||||
- Prompt user for confirmation to continue
|
||||
- Proceed if user confirms
|
||||
|
||||
**If no tasks file exists:** Proceed without task-related warning.
|
||||
|
||||
4. **Assess delta spec sync state**
|
||||
|
||||
Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
|
||||
delta-spec source. If the `specs` entry is missing or
|
||||
`existingOutputPaths` is empty, proceed without a sync prompt and do not infer
|
||||
delta specs from other artifacts.
|
||||
|
||||
**If delta specs exist:**
|
||||
- Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)
|
||||
- Determine what changes would be applied (adds, modifications, removals, renames)
|
||||
- Show a combined summary before prompting
|
||||
|
||||
**Prompt options:**
|
||||
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
||||
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
||||
|
||||
Route on the answer:
|
||||
- "Cancel" — stop, do not archive
|
||||
- "Archive without syncing" or "Archive now" — proceed to archive
|
||||
- "Sync now" or "Sync anyway" — sync, then verify (below)
|
||||
- Anything else — ask again rather than archiving
|
||||
|
||||
Before a selected sync writes any main spec, run
|
||||
`openspec instructions specs --change "<name>" --json` once with the same
|
||||
selected-root flags. Require a zero exit status and valid artifact-instruction
|
||||
JSON. If the lookup fails or returns invalid JSON, report the error and stop
|
||||
before writing any main spec or moving the change. A valid response with omitted
|
||||
`rules` is the no-rules case. Apply returned `rules` only to the content and
|
||||
form of main specs produced by this merge; do not use them as archive guidance,
|
||||
change CLI behavior, or copy the rule text into any output file.
|
||||
|
||||
Then run the `/opsx:sync` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
|
||||
|
||||
Then re-run the comparison from the top of this step against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
|
||||
- ADDED requirements present
|
||||
- MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
|
||||
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
|
||||
- RENAMED requirements present under the new name and absent under the old one
|
||||
|
||||
If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
|
||||
|
||||
5. **Perform the archive**
|
||||
|
||||
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
|
||||
```bash
|
||||
mkdir -p "<planningHome.changesDir>/archive"
|
||||
```
|
||||
|
||||
Generate the target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
|
||||
|
||||
**Check if target already exists:**
|
||||
- If yes: Fail with error, suggest renaming existing archive or using different date
|
||||
- If no: Move `changeRoot` to the archive directory
|
||||
|
||||
```bash
|
||||
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
|
||||
```
|
||||
|
||||
6. **Display summary**
|
||||
|
||||
Show archive completion summary including:
|
||||
- Change name
|
||||
- Schema that was used
|
||||
- Archive location
|
||||
- Spec sync status (synced / sync skipped / no delta specs)
|
||||
- Note about any warnings (incomplete artifacts/tasks)
|
||||
|
||||
**Output On Success**
|
||||
|
||||
```markdown
|
||||
## Archive Complete
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
||||
**Specs:** ✓ Synced to main specs
|
||||
|
||||
All artifacts complete. All tasks complete.
|
||||
```
|
||||
|
||||
**Output On Success (No Delta Specs)**
|
||||
|
||||
```markdown
|
||||
## Archive Complete
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
||||
**Specs:** No delta specs
|
||||
|
||||
All artifacts complete. All tasks complete.
|
||||
```
|
||||
|
||||
**Output On Success With Warnings**
|
||||
|
||||
```markdown
|
||||
## Archive Complete (with warnings)
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
||||
**Specs:** Sync skipped (user chose to skip)
|
||||
|
||||
**Warnings:**
|
||||
- Archived with 2 incomplete artifacts
|
||||
- Archived with 3 incomplete tasks
|
||||
- Delta spec sync was skipped (user chose to skip)
|
||||
|
||||
Review the archive if this was not intentional.
|
||||
```
|
||||
|
||||
**Output On Error (Archive Exists)**
|
||||
|
||||
```markdown
|
||||
## Archive Failed
|
||||
|
||||
**Change:** <change-name>
|
||||
**Target:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
||||
|
||||
Target archive directory already exists.
|
||||
|
||||
**Options:**
|
||||
1. Rename the existing archive
|
||||
2. Delete the existing archive if it's a duplicate
|
||||
3. Wait until a different date to archive
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
- Announce the selected change; prompt for selection when it is ambiguous
|
||||
- Use artifact graph (openspec status --json) for completion checking
|
||||
- Don't block archive on warnings - just inform and confirm
|
||||
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
||||
- Show clear summary of what happened
|
||||
- If sync is requested, run the `/opsx:sync` workflow inline (agent-driven)
|
||||
- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
|
||||
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
||||
- Apply relevant runtime context and report conflicts; operation guidance remains advisory
|
||||
- Consider every guidance entry and explain any inapplicable or conflicting advice
|
||||
- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
|
||||
- Artifact rules constrain only the specs being written and are never operation guidance
|
||||
- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
|
||||
@@ -0,0 +1,193 @@
|
||||
---
|
||||
name: "OPSX: Explore"
|
||||
description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
|
||||
allowed-tools: Bash(openspec:*)
|
||||
category: "Workflow"
|
||||
tags: ["workflow", "explore", "experimental", "thinking"]
|
||||
---
|
||||
|
||||
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
|
||||
|
||||
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. For a new change, scaffold it first as described below.
|
||||
|
||||
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
|
||||
- A vague idea: "real-time collaboration"
|
||||
- A specific problem: "the auth system is getting unwieldy"
|
||||
- A change name: "add-dark-mode" (to explore in context of that change)
|
||||
- A comparison: "postgres vs sqlite for this"
|
||||
- Nothing (just enter explore mode)
|
||||
|
||||
---
|
||||
|
||||
## The Stance
|
||||
|
||||
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
||||
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
|
||||
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
||||
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
||||
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
||||
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
||||
|
||||
---
|
||||
|
||||
## What You Might Do
|
||||
|
||||
Depending on what the user brings, you might:
|
||||
|
||||
**Explore the problem space**
|
||||
- Ask clarifying questions that emerge from what they said
|
||||
- Challenge assumptions
|
||||
- Reframe the problem
|
||||
- Find analogies
|
||||
|
||||
**Investigate the codebase**
|
||||
- Map existing architecture relevant to the discussion
|
||||
- Find integration points
|
||||
- Identify patterns already in use
|
||||
- Surface hidden complexity
|
||||
|
||||
**Compare options**
|
||||
- Brainstorm multiple approaches
|
||||
- Build comparison tables
|
||||
- Sketch tradeoffs
|
||||
- Recommend a path (if asked)
|
||||
|
||||
**Visualize**
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ Use ASCII diagrams liberally │
|
||||
├─────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌────────┐ ┌────────┐ │
|
||||
│ │ State │────────▶│ State │ │
|
||||
│ │ A │ │ B │ │
|
||||
│ └────────┘ └────────┘ │
|
||||
│ │
|
||||
│ System diagrams, state machines, │
|
||||
│ data flows, architecture sketches, │
|
||||
│ dependency graphs, comparison tables │
|
||||
│ │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
**Surface risks and unknowns**
|
||||
- Identify what could go wrong
|
||||
- Find gaps in understanding
|
||||
- Suggest spikes or investigations
|
||||
|
||||
---
|
||||
|
||||
## OpenSpec Awareness
|
||||
|
||||
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
||||
|
||||
### Check for context
|
||||
|
||||
At the start, quickly check what exists:
|
||||
```bash
|
||||
openspec list --json
|
||||
```
|
||||
|
||||
This tells you:
|
||||
- If there are active changes
|
||||
- Their names, schemas, and status
|
||||
- What the user might be working on
|
||||
|
||||
Then read the project's own context from the resolved root - `<root.path>/openspec/config.yaml` (or `config.yml`). Use the `root.path` returned above, and skip this if neither file exists:
|
||||
- `context`: project background - tech stack, conventions, constraints
|
||||
- `rules`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
|
||||
|
||||
Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
|
||||
|
||||
If the user mentioned a specific change name, read its artifacts for context.
|
||||
|
||||
### When no change exists
|
||||
|
||||
Think freely. When insights crystallize, you might offer:
|
||||
|
||||
- "This feels solid enough to start a change. Want me to create a proposal?"
|
||||
- Or keep exploring - no pressure to formalize
|
||||
|
||||
If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
|
||||
|
||||
1. Run `openspec new change "<name>"` (with `--store <id>` when applicable) before creating any artifacts. Never create a new change directory under `openspec/changes/` by hand; the CLI scaffold creates required metadata such as `.openspec.yaml`. Keep the selected `--store <id>` on every applicable follow-up `status` and `instructions` command.
|
||||
2. Run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is `ready`, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own `instruction` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run `openspec instructions "<prerequisite-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) for that prerequisite whether it is `ready` or `blocked`. If its own `instruction` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
|
||||
3. Follow the returned `template` and `instruction` fields. Read completed dependency files listed in `dependencies`, and apply `context` and `rules` as constraints without copying them into the artifact. If the instruction delegates creation to a specific skill or command, invoke it; otherwise write the artifact to `resolvedOutputPath`, using the instruction to choose a concrete path when it is a glob. Verify that the selected concrete output exists.
|
||||
4. After creating each artifact, re-run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) and continue until every requested artifact is `done`, `skipped`, or was deliberately skipped because its own `instruction` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still `blocked` only because you deliberately skipped a conditional prerequisite, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
|
||||
|
||||
Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status.
|
||||
|
||||
### When a change exists
|
||||
|
||||
If the user mentions a change or you detect one is relevant:
|
||||
|
||||
1. **Resolve and read existing artifacts for context**
|
||||
- Run `openspec status --change "<name>" --json`.
|
||||
- Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
|
||||
- Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
|
||||
|
||||
2. **Reference them naturally in conversation**
|
||||
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
||||
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
||||
|
||||
3. **Offer to capture when decisions are made**
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
|
||||
|
||||
| Insight Type | Where to Capture |
|
||||
|----------------------------|-------------------------------------|
|
||||
| New requirement discovered | `specs/<capability-path>/spec.md` |
|
||||
| Requirement changed | `specs/<capability-path>/spec.md` |
|
||||
| Design decision made | `design.md` |
|
||||
| Scope changed | `proposal.md` |
|
||||
| New work identified | `tasks.md` |
|
||||
| Assumption invalidated | Relevant artifact |
|
||||
|
||||
Example offers:
|
||||
- "That's a design decision. Capture it in design.md?"
|
||||
- "This is a new requirement. Add it to specs?"
|
||||
- "This changes scope. Update the proposal?"
|
||||
|
||||
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
||||
|
||||
---
|
||||
|
||||
## What You Don't Have To Do
|
||||
|
||||
- Follow a script
|
||||
- Ask the same questions every time
|
||||
- Produce a specific artifact
|
||||
- Reach a conclusion
|
||||
- Stay on topic if a tangent is valuable
|
||||
- Be brief (this is thinking time)
|
||||
|
||||
---
|
||||
|
||||
## Ending Discovery
|
||||
|
||||
There's no required ending. Discovery might:
|
||||
|
||||
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
|
||||
- **Result in artifact updates**: "Updated design.md with these decisions"
|
||||
- **Just provide clarity**: User has what they need, moves on
|
||||
- **Continue later**: "We can pick this up anytime"
|
||||
|
||||
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
|
||||
|
||||
---
|
||||
|
||||
## Guardrails
|
||||
|
||||
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
|
||||
- **Don't fake understanding** - If something is unclear, dig deeper
|
||||
- **Don't rush** - Discovery is thinking time, not task time
|
||||
- **Don't force structure** - Let patterns emerge naturally
|
||||
- **Don't auto-capture** - Offer to save insights, don't just do it
|
||||
- **Don't manually scaffold changes** - Never create a new change directory under `openspec/changes/` by hand. Always use `openspec new change "<name>"` (with `--store <id>` when applicable) so required metadata such as `.openspec.yaml` is created before writing artifacts.
|
||||
- **Do visualize** - A good diagram is worth many paragraphs
|
||||
- **Do explore the codebase** - Ground discussions in reality
|
||||
- **Do question assumptions** - Including the user's and your own
|
||||
@@ -0,0 +1,145 @@
|
||||
---
|
||||
name: "OPSX: Propose"
|
||||
description: "Propose a new change - create it and generate all artifacts in one step"
|
||||
allowed-tools: Bash(openspec:*)
|
||||
category: "Workflow"
|
||||
tags: ["workflow", "artifacts", "experimental"]
|
||||
---
|
||||
|
||||
Propose a new change - create the change and generate all artifacts in one step.
|
||||
|
||||
**Planning boundary**: This workflow creates planning artifacts only. The user request that selected or triggered this workflow authorizes planning only, even if it asks to build or fix something. Do not edit project code. After the planning artifacts are complete, stop. Do not start implementation in the same response, even if the initial request asks for it. Wait for a new user request after the artifacts are presented; then start the apply workflow.
|
||||
|
||||
I'll create a change with the artifacts your schema defines. With the default spec-driven schema that is:
|
||||
- proposal.md (what & why)
|
||||
- `specs/<capability-path>/spec.md` (what the system must do - a delta, not the main spec)
|
||||
- design.md (how)
|
||||
- tasks.md (implementation steps)
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
|
||||
|
||||
When the user is ready to implement, they must start the apply workflow explicitly.
|
||||
|
||||
---
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
**Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Understand the request and clarify material ambiguity**
|
||||
|
||||
If no input is provided, ask the user (open-ended, no preset options):
|
||||
> "What change do you want to work on? Describe what you want to build or fix."
|
||||
|
||||
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
|
||||
|
||||
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
||||
|
||||
If the request contains ambiguity that would materially affect scope, externally observable behavior, compatibility, or acceptance criteria, ask the user before creating the change. For minor details, make a reasonable assumption and record it in the planning artifacts.
|
||||
|
||||
2. **Determine the workflow schema**
|
||||
|
||||
Use the configured default schema unless the user explicitly requests a different workflow.
|
||||
|
||||
**Use a different schema only if the user:**
|
||||
- Explicitly requests a specific schema by name → use `--schema <schema-name>`
|
||||
- Asks to "show workflows" or asks "what workflows" exist → resolve the authoritative root by running `openspec context --json` from the current working directory. If the user explicitly selected a registered store, use `openspec context --json --store "<store-id>"`. Then run `openspec schemas --json` with its working directory set to the returned `root.path` and let them choose. This preserves roots selected by a local `store:` pointer or the global `defaultStore`; `schemas` does not accept `--store`. If context reports only `no_openspec_root`, run `openspec schemas --json` from the current working directory instead. Do not use this fallback for invalid or unavailable stores.
|
||||
|
||||
Otherwise, omit `--schema` to preserve the configured default.
|
||||
|
||||
3. **Create the change directory**
|
||||
|
||||
Choose one schema form below. If a registered store is selected, append `--store "<store-id>"` to that command and each later OpenSpec command shown below that accepts `--store`.
|
||||
|
||||
Using the configured default:
|
||||
```bash
|
||||
openspec new change "<name>"
|
||||
```
|
||||
|
||||
Using an explicitly requested schema:
|
||||
```bash
|
||||
openspec new change "<name>" --schema "<schema-name>"
|
||||
```
|
||||
This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
|
||||
|
||||
4. **Get the artifact build order**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
Parse the JSON to get:
|
||||
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
||||
- `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
|
||||
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
||||
|
||||
5. **Create every artifact in the required set**
|
||||
|
||||
Use a todo list to track progress through the artifacts.
|
||||
|
||||
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
|
||||
|
||||
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
||||
- Get instructions:
|
||||
```bash
|
||||
openspec instructions <artifact-id> --change "<name>" --json
|
||||
```
|
||||
- The instructions JSON includes:
|
||||
- `context`: Project background (constraints for you - do NOT include in output)
|
||||
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
|
||||
- `template`: The structure to use for your output file
|
||||
- `instruction`: Schema-specific guidance for this artifact type
|
||||
- `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
|
||||
- `resolvedOutputPath`: Resolved path or pattern to write the artifact
|
||||
- `dependencies`: Completed artifacts to read for context
|
||||
- Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
|
||||
- If the `instruction` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at `resolvedOutputPath`
|
||||
- Otherwise create the artifact file using `template` as the structure and write it to `resolvedOutputPath`. If `resolvedOutputPath` is a glob, follow `instruction` to choose the concrete file path
|
||||
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
|
||||
- Show brief progress: "Created <artifact-id>"
|
||||
|
||||
b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
|
||||
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
||||
- The required set is `applyRequires` plus every artifact reachable from those by following the `requires` edges in `status --json` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
|
||||
- `status` is file-existence only, so an `applyRequires` artifact reading `done` does NOT mean its dependencies exist - writing `tasks.md` early marks `tasks` done while `specs` was never written. Use each artifact's `requires` edges, not its `status`, to build the required set: a `done` artifact still lists what it depends on
|
||||
- An artifact already reading `status: "skipped"` is satisfied: the change declares `skip_specs` in `.openspec.yaml`, so its files must NOT exist. Never try to create one
|
||||
- Create every artifact in the required set that is missing, then re-check - creating one can unblock others
|
||||
- Skip one only when `status` already reports it `skipped`, or when its own `instruction` says it is conditional: run `openspec instructions <artifact-id> --change "<name>" --json` and skip only if its `instruction` field marks it optional (e.g. "create only if..."). Spec-driven's `design.md` qualifies; `specs` qualifies only via the `skipped` status above, never by your own judgment. Tell the user, and do not reconsider it
|
||||
- Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
|
||||
- Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
|
||||
|
||||
c. **If an artifact requires user input** (unclear context):
|
||||
- Ask the user to clarify
|
||||
- Then continue with creation
|
||||
|
||||
6. **Show final status**
|
||||
```bash
|
||||
openspec status --change "<name>"
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
After completing all artifacts, summarize:
|
||||
- Change name and location
|
||||
- List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
|
||||
- What's ready: "All artifacts needed for implementation are ready."
|
||||
- Prompt: "The artifacts are ready for review. When you are ready, run `/opsx:apply`."
|
||||
|
||||
**Artifact Creation Guidelines**
|
||||
|
||||
- Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
|
||||
- If the `instruction` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
|
||||
- The schema defines what each artifact should contain - follow it
|
||||
- Read dependency artifacts for context before creating new ones
|
||||
- Use `template` as the structure for your output file - fill in its sections
|
||||
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
|
||||
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
|
||||
- These guide what you write, but should never appear in the output
|
||||
|
||||
**Guardrails**
|
||||
- The request that invoked this workflow authorizes planning only. Any implementation or apply instruction in that request does not carry forward. Do NOT implement the change, start the apply workflow, or edit project code during this workflow. After presenting the artifacts, stop and wait for a new user request to start the apply workflow
|
||||
- Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
|
||||
- Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
|
||||
- Ask about ambiguities that would materially change scope, externally observable behavior, compatibility, or acceptance criteria; for minor details, make reasonable assumptions and record them
|
||||
- If a change with that name already exists, ask if user wants to continue it or create a new one
|
||||
- Verify each artifact file exists after writing before proceeding to next
|
||||
@@ -0,0 +1,258 @@
|
||||
---
|
||||
name: "OPSX: Sync"
|
||||
description: "Sync delta specs from a change to main specs"
|
||||
allowed-tools: Bash(openspec:*)
|
||||
category: "Workflow"
|
||||
tags: ["workflow", "specs", "experimental"]
|
||||
---
|
||||
|
||||
Sync delta specs from a change to main specs.
|
||||
|
||||
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
||||
|
||||
**Input**: Optionally specify a change name after `/opsx:sync` (e.g., `/opsx:sync add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
||||
|
||||
When prompting, show changes that have delta specs (under `specs/` directory).
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:sync <other>`).
|
||||
|
||||
2. **Resolve change context**
|
||||
|
||||
Run:
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
|
||||
The JSON includes `planningHome.root`. Main specs live under `<planningHome.root>/openspec/specs/` — use that (store-aware) root for every main-spec path below, not a hardcoded repo path. When a store is selected it points at the store, not the current repository.
|
||||
|
||||
3. **Find delta specs**
|
||||
|
||||
Use `artifactPaths.specs.existingOutputPaths` from the status JSON as the
|
||||
only source of delta spec paths. If the `specs` entry is missing or
|
||||
`existingOutputPaths` is empty, report that there are no delta specs to sync,
|
||||
do not infer them from other artifacts, and stop without requesting artifact
|
||||
instructions or writing a main spec.
|
||||
|
||||
Sync every path in `existingOutputPaths` unless the caller narrowed the set.
|
||||
A caller narrows it by naming an explicit list of complete entries from
|
||||
`existingOutputPaths` — copy those absolute values verbatim. Archive does
|
||||
this inline, and a user can too (for example, by selecting the entry ending
|
||||
in `/specs/billing/invoices/spec.md`).
|
||||
Then sync only the named paths and leave the remaining delta specs untouched:
|
||||
bulk archive excludes a delta whose implementation it could not find, and
|
||||
syncing it anyway would write a main spec the caller deliberately withheld.
|
||||
Carry that narrowed selection through step 4; never widen it back to the full
|
||||
list. If a named path is not in `existingOutputPaths`, do not sync it —
|
||||
report it and stop, rather than dropping it silently. If the named list is
|
||||
empty, report that there is nothing to sync and stop without writing a main
|
||||
spec.
|
||||
|
||||
Each delta spec file contains sections like:
|
||||
- `## ADDED Requirements` - New requirements to add
|
||||
- `## MODIFIED Requirements` - Changes to existing requirements
|
||||
- `## REMOVED Requirements` - Requirements to remove
|
||||
- `## RENAMED Requirements` - Requirements to rename (FROM:/TO: format)
|
||||
|
||||
If no delta specs found, inform user and stop.
|
||||
|
||||
4. **For each delta spec, apply changes to main specs**
|
||||
|
||||
Before the first main-spec write, obtain one current specs-rule snapshot:
|
||||
- If archive invoked this workflow inline and supplied a valid snapshot from
|
||||
`openspec instructions specs --change "<name>" --json`, reuse it and do not
|
||||
fetch the same instructions again.
|
||||
- Otherwise run that command once now with the same selected-root flags.
|
||||
- If the direct lookup exits non-zero or returns invalid artifact-instruction
|
||||
JSON, report the error and stop before writing any main spec. Do not treat the
|
||||
failure as an absent rule set.
|
||||
- A valid response with omitted `rules` means no artifact rules are configured
|
||||
and the existing semantic merge continues.
|
||||
|
||||
Apply returned `rules` only to the content and form of the main specs produced
|
||||
by this merge. Artifact rules are not operation guidance and cannot change
|
||||
selected roots, delta paths, CLI checks, or workflow steps. Use their text as
|
||||
constraints without copying it verbatim into a main spec or summary.
|
||||
|
||||
For each capability delta spec path selected in step 3 — the full `existingOutputPaths` list, or the narrowed subset when a caller supplied one (these may belong to a selected store, not the repo):
|
||||
|
||||
a. **Read the delta spec** to understand the intended changes
|
||||
|
||||
b. **Read the main spec** at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (may not exist yet)
|
||||
|
||||
c. **Apply changes intelligently**:
|
||||
|
||||
**ADDED Requirements:**
|
||||
- If requirement doesn't exist in main spec → add it
|
||||
- If requirement already exists → update it to match (treat as implicit MODIFIED)
|
||||
|
||||
**MODIFIED Requirements:**
|
||||
- Find the requirement in main spec
|
||||
- Apply the changes - this can be:
|
||||
- Adding new scenarios the main spec does not have yet
|
||||
- Modifying existing scenarios
|
||||
- Changing the requirement description
|
||||
- Preserve scenarios/content not mentioned in the delta
|
||||
|
||||
**REMOVED Requirements:**
|
||||
- Remove the entire requirement block from main spec
|
||||
- Retiring the capability. Delete the whole `spec.md` - and the directory once
|
||||
nothing else is left in it - only when ALL of these hold:
|
||||
1. removing the requirements *this run* left no requirement blocks;
|
||||
2. the rest of the spec is well-formed (it still has a `## Purpose`);
|
||||
3. the main spec was not already empty before this sync - if you removed
|
||||
nothing, change nothing;
|
||||
4. every other nonblank line in the whole file is accounted for as the
|
||||
title, Purpose, Requirements header, or a canonical requirement's
|
||||
statement, scenarios, or fenced examples;
|
||||
5. the change's `.openspec.yaml` declares `retire_capabilities: true`;
|
||||
6. the `spec.md` resolves inside the real specs root (do not follow a
|
||||
capability-directory symlink to delete an external file).
|
||||
If removing the selected requirements would leave no requirement blocks and
|
||||
any retirement condition is not satisfied, do not modify the main spec. Stop
|
||||
the sync for that capability, report the blocking condition, and tell the user
|
||||
how to resolve it. Never write or leave an empty `## Requirements` section.
|
||||
When only the marker is missing, say that too - it is the one thing the user
|
||||
can add to make the retirement go through.
|
||||
- Deleting the file also deletes its `## Purpose`; any other section blocks
|
||||
retirement. Name Purpose when you report the retirement. Include a pasteable
|
||||
`git checkout` only when the spec lived in the caller's checkout;
|
||||
otherwise give checkout-scoped recovery guidance.
|
||||
|
||||
**RENAMED Requirements:**
|
||||
- Find the FROM requirement, rename to TO
|
||||
|
||||
**`## Purpose` in the delta:**
|
||||
- The main spec already has one and it is authoritative - leave it alone
|
||||
(this is what `openspec archive` does; it warns and moves on)
|
||||
|
||||
d. **Create new main spec** if capability doesn't exist yet:
|
||||
- Create `<planningHome.root>/openspec/specs/<capability-path>/spec.md`
|
||||
- Add Purpose section: copy the delta's `## Purpose` body verbatim when it has one
|
||||
(this is what `openspec archive` does); only write a brief TBD placeholder when it does not
|
||||
- Add Requirements section with the ADDED requirements
|
||||
- Follow the **Main Spec Format Reference** below
|
||||
|
||||
5. **Validate updated main specs**
|
||||
|
||||
Run `openspec validate --specs` with the same selected-root flags used earlier.
|
||||
If validation fails, report the problems and do not claim the sync succeeded.
|
||||
|
||||
6. **Show summary**
|
||||
|
||||
After applying all changes, summarize:
|
||||
- Which capabilities were updated
|
||||
- What changes were made (requirements added/modified/removed/renamed)
|
||||
- Any new main spec left with a TBD Purpose placeholder, so it gets written
|
||||
now rather than lingering
|
||||
- Any capability retired, naming the deleted `spec.md`, its Purpose, and
|
||||
either a pasteable `git checkout` or checkout-scoped recovery guidance
|
||||
|
||||
**Delta Spec Format Reference**
|
||||
|
||||
```markdown
|
||||
## Purpose
|
||||
|
||||
Only on a delta that introduces a brand-new capability. Seeds the new main spec.
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: New Feature
|
||||
The system SHALL do something new.
|
||||
|
||||
#### Scenario: Basic case
|
||||
- **WHEN** user does X
|
||||
- **THEN** system does Y
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Existing Feature
|
||||
The system SHALL keep doing the existing thing, now also handling A.
|
||||
|
||||
#### Scenario: Scenario the main spec already has
|
||||
- **WHEN** user does X
|
||||
- **THEN** system does Y
|
||||
|
||||
#### Scenario: New scenario to add
|
||||
- **WHEN** user does A
|
||||
- **THEN** system does B
|
||||
|
||||
## REMOVED Requirements
|
||||
|
||||
### Requirement: Deprecated Feature
|
||||
|
||||
## RENAMED Requirements
|
||||
|
||||
- FROM: `### Requirement: Old Name`
|
||||
- TO: `### Requirement: New Name`
|
||||
```
|
||||
|
||||
**Main Spec Format Reference**
|
||||
|
||||
Main specs are what the delta merges INTO. They must never contain delta operation headers (`## ADDED/MODIFIED/REMOVED/RENAMED Requirements`) - after syncing, every requirement lives under a single `## Requirements` section:
|
||||
|
||||
```markdown
|
||||
# <capability> Specification
|
||||
|
||||
## Purpose
|
||||
Short description of what this capability does and why it exists.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Requirement: New Feature
|
||||
The system SHALL do something new.
|
||||
|
||||
#### Scenario: Basic case
|
||||
- **WHEN** user does X
|
||||
- **THEN** system does Y
|
||||
```
|
||||
|
||||
**Key Principle: Intelligent Merging**
|
||||
|
||||
Unlike programmatic merging, you merge rather than overwrite:
|
||||
- A MODIFIED block carries the whole requirement - body plus every scenario that survives the change. `openspec validate` and `openspec archive` both reject one that drops a scenario the main spec still has.
|
||||
- Keep anything the delta does not mention, in the main spec's existing order
|
||||
- Use your judgment to merge changes sensibly
|
||||
|
||||
**Output On Success**
|
||||
|
||||
```markdown
|
||||
## Specs Synced: <change-name>
|
||||
|
||||
Updated main specs:
|
||||
|
||||
**<capability-1>**:
|
||||
- Added requirement: "New Feature"
|
||||
- Modified requirement: "Existing Feature" (added 1 scenario)
|
||||
|
||||
**<capability-2>**:
|
||||
- Created new spec file
|
||||
- Added requirement: "Another Feature"
|
||||
|
||||
Main specs are now updated. The change remains active - archive when implementation is complete.
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
- Read both delta and main specs before making changes
|
||||
- Preserve existing content not mentioned in delta
|
||||
- Never copy a delta file into a main spec as-is - merge its content so the main spec keeps the Main Spec Format Reference structure, with no delta operation headers
|
||||
- If something is unclear, ask for clarification
|
||||
- Show what you're changing as you go
|
||||
- The operation should be idempotent - running twice should give same result
|
||||
- Use only `artifactPaths.specs.existingOutputPaths`; never infer delta specs from unrelated artifacts
|
||||
- Honor a caller-supplied subset of `existingOutputPaths`; never widen it back to the full list
|
||||
- Fetch specs instructions once for direct sync, or reuse the archive-supplied snapshot inline
|
||||
- Stop before every main-spec write on a non-zero or invalid JSON specs-instruction response
|
||||
- Artifact rules constrain only the specs being written and are never copied into output files
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
name: "OPSX: Update"
|
||||
description: "Update a change - revise existing planning artifacts and keep them coherent (Experimental)"
|
||||
allowed-tools: Bash(openspec:*)
|
||||
category: "Workflow"
|
||||
tags: ["workflow", "artifacts", "experimental"]
|
||||
---
|
||||
|
||||
Revise a change's existing planning artifacts and keep them coherent. Never edit code.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
**Input**: Optionally specify a change name after `/opsx:update` (e.g., `/opsx:update add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
`/opsx:continue` is an expanded-profile workflow and may not be installed. Before suggesting it anywhere below, verify that it is available. If it is unavailable, `openspec status --change "<name>" --json` shows the next artifact and `openspec instructions "<artifact-id>" --change "<name>" --json` explains how to create it.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
|
||||
|
||||
When prompting, present the top 3-4 most recently modified changes as options, showing:
|
||||
- Change name
|
||||
- Schema (from `schema` field if present, otherwise "spec-driven")
|
||||
- Status (e.g., "0/5 tasks", "complete", "no tasks")
|
||||
- How recently it was modified (from `lastModified` field)
|
||||
|
||||
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:update <other>`).
|
||||
|
||||
2. **Get the change's artifacts**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
Parse the JSON to understand current state. The response includes:
|
||||
- `schemaName`: The workflow schema being used (e.g., "spec-driven")
|
||||
- `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
|
||||
- `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
|
||||
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
||||
|
||||
The artifact ids and paths come from the active schema - do NOT assume them, and do NOT branch on hardcoded artifact names. Custom schemas must work unchanged.
|
||||
|
||||
The files to edit are `artifactPaths.<id>.existingOutputPaths` - the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. `specs/**/*.md`). Do NOT write to `resolvedOutputPath`: for a glob artifact it is still the glob pattern, not a real file.
|
||||
|
||||
3. **Understand the request**
|
||||
- If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
|
||||
- If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
|
||||
|
||||
4. **Read and reconcile**
|
||||
- Read the artifact(s) the request touches and the change's other existing artifacts.
|
||||
- Apply the requested edit. Then check every other existing artifact against it - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
|
||||
- Note everything that is now inconsistent, missing, or contradictory.
|
||||
- Revise only files that already exist (`existingOutputPaths`). Do NOT create artifacts that don't exist yet, and do NOT invent new files under a glob artifact - note them and point the user to `/opsx:continue` to create them.
|
||||
- If the change is already coherent, say so and make no edits.
|
||||
|
||||
5. **Confirm and apply, one artifact at a time**
|
||||
- Show each proposed revision and why. Write only after the user confirms.
|
||||
- If the user rejects a revision, do not write it - leave that artifact unchanged.
|
||||
- When a substantial rewrite is needed, get that artifact's rules and template first:
|
||||
```bash
|
||||
openspec instructions "<artifact-id>" --change "<name>" --json
|
||||
```
|
||||
|
||||
6. **Point to the next step (guidance only - NEVER act on it)**
|
||||
- Artifacts still missing -> suggest `/opsx:continue` to create them.
|
||||
- Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `/opsx:apply` to carry the delta into code.
|
||||
- Everything done and implemented -> suggest `/opsx:archive`.
|
||||
|
||||
**Output**
|
||||
|
||||
After each invocation, show:
|
||||
- Which artifacts were revised (and which proposed revisions were rejected)
|
||||
- Anything deferred to `/opsx:continue` (not-yet-created artifacts or files)
|
||||
- Where the change stands and the recommended next command
|
||||
|
||||
**Guardrails**
|
||||
- Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/opsx:apply`.
|
||||
- Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
|
||||
- Edit only the concrete files in `existingOutputPaths`; never write to a glob `resolvedOutputPath`.
|
||||
- Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is `/opsx:continue`'s job.
|
||||
- Confirm every edit with the user before writing.
|
||||
- If the request changes the change's *intent* rather than refining it, first verify whether the expanded-profile `/opsx:new` workflow is available. If it is, recommend starting fresh with `/opsx:new` (the "Update vs. Start Fresh" heuristic). If it is unavailable, ask for a distinct unused change name and recommend `openspec new change "<new-change-name>"` instead.
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
set -uo pipefail
|
||||
|
||||
ROOT="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}"
|
||||
PAYLOAD=$(cat)
|
||||
FILE=$(printf '%s' "$PAYLOAD" | /usr/bin/python3 -c 'import json,sys
|
||||
try:
|
||||
d = json.load(sys.stdin)
|
||||
except Exception:
|
||||
sys.exit(0)
|
||||
t = d.get("tool_input") or {}
|
||||
r = d.get("tool_response") or {}
|
||||
p = r.get("filePath") or t.get("file_path") or ""
|
||||
print(p)
|
||||
' 2>/dev/null)
|
||||
|
||||
case "$FILE" in
|
||||
"") exit 0 ;;
|
||||
*.py) ;;
|
||||
*) exit 0 ;;
|
||||
esac
|
||||
|
||||
case "$FILE" in
|
||||
"$ROOT"/src/*) ;;
|
||||
src/*) FILE="$ROOT/$FILE" ;;
|
||||
*) exit 0 ;;
|
||||
esac
|
||||
|
||||
[ -f "$FILE" ] || exit 0
|
||||
[ -x "$ROOT/.venv/bin/ruff" ] || exit 0
|
||||
|
||||
OUT=$(
|
||||
cd "$ROOT" || exit 0
|
||||
"$ROOT/.venv/bin/ruff" check --fix --quiet "$FILE" 2>&1
|
||||
"$ROOT/.venv/bin/ruff" format --quiet "$FILE" 2>&1
|
||||
if [ -x "$ROOT/.venv/bin/ty" ]; then
|
||||
"$ROOT/.venv/bin/ty" check --quiet "$FILE" 2>&1 | grep -v "^All checks passed" || true
|
||||
fi
|
||||
)
|
||||
|
||||
if [ -n "$OUT" ]; then
|
||||
printf 'ruff/ty по %s:\n%s\n' "${FILE#"$ROOT"/}" "$OUT" >&2
|
||||
exit 2
|
||||
fi
|
||||
exit 0
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Write|Edit|MultiEdit|NotebookEdit",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/lint-python.sh",
|
||||
"timeout": 60,
|
||||
"statusMessage": "ruff + ty по src/"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
---
|
||||
name: openspec-apply-change
|
||||
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
|
||||
allowed-tools: Bash(openspec:*)
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.8.0"
|
||||
---
|
||||
|
||||
Implement tasks from an OpenSpec change.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
||||
|
||||
2. **Check status to understand the schema**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
Parse the JSON to understand:
|
||||
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
||||
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
|
||||
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
||||
|
||||
3. **Get apply instructions**
|
||||
|
||||
```bash
|
||||
openspec instructions apply --change "<name>" --json
|
||||
```
|
||||
|
||||
This returns:
|
||||
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
||||
- Progress (total, complete, remaining)
|
||||
- Task list with status
|
||||
- Dynamic instruction based on current state
|
||||
- Optional `context`: current required project instruction input from the selected root
|
||||
- Optional `operationGuidance`: current advisory guidance for apply
|
||||
|
||||
**Handle states:**
|
||||
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` (if it is not installed, run `openspec status --change "<name>" --json` to see the next artifact and `openspec instructions <artifact-id> --change "<name>" --json` for how to create it)
|
||||
- If `state: "all_done"`: congratulate, suggest archive
|
||||
- Otherwise: proceed to implementation
|
||||
|
||||
Treat `context` as a required prompt-level input. Read and consider it, and
|
||||
apply relevant project facts, conventions, and constraints while implementing.
|
||||
Treat `operationGuidance` as optional additive advice. Read and consider every
|
||||
entry, and follow entries that are applicable and compatible with the built-in
|
||||
workflow.
|
||||
|
||||
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
|
||||
progress, `contextFiles`, and the built-in `instruction`. They are not
|
||||
evidence of task completion, do not replace the built-in instruction, and do
|
||||
not permit bypassing a blocked state. If context conflicts with the built-in
|
||||
instruction, an explicit user choice, or a CLI-controlled value, report the
|
||||
conflict and preserve the controlling value. If guidance is inapplicable or
|
||||
conflicts with those controlling inputs, do not follow it and explain why.
|
||||
These are prompt-level behavior contracts, not enforceable checks.
|
||||
|
||||
4. **Read context files**
|
||||
|
||||
Read every file path listed under `contextFiles` from the apply instructions output.
|
||||
The files depend on the schema being used:
|
||||
- **spec-driven**: proposal, specs, design, tasks
|
||||
- Other schemas: follow the contextFiles from CLI output
|
||||
|
||||
Do not copy `context` or `operationGuidance` verbatim into implementation
|
||||
files or planning artifacts unless the user separately asks for that content.
|
||||
|
||||
5. **Show current progress**
|
||||
|
||||
Display:
|
||||
- Schema being used
|
||||
- Progress: "N/M tasks complete"
|
||||
- Remaining tasks overview
|
||||
- Dynamic instruction from CLI
|
||||
|
||||
6. **Implement tasks (loop until done or blocked)**
|
||||
|
||||
For each pending task:
|
||||
- Show which task is being worked on
|
||||
- Make the code changes required
|
||||
- Keep changes minimal and focused
|
||||
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
||||
- Continue to next task
|
||||
|
||||
**Pause if:**
|
||||
- Task is unclear → ask for clarification
|
||||
- Implementation reveals a design issue → suggest updating artifacts
|
||||
- Error or blocker encountered → report and wait for guidance
|
||||
- User interrupts
|
||||
|
||||
7. **On completion or pause, show status**
|
||||
|
||||
Display:
|
||||
- Tasks completed this session
|
||||
- Overall progress: "N/M tasks complete"
|
||||
- If all done: suggest archive
|
||||
- If paused: explain why and wait for guidance
|
||||
|
||||
**Output During Implementation**
|
||||
|
||||
```
|
||||
## Implementing: <change-name> (schema: <schema-name>)
|
||||
|
||||
Working on task 3/7: <task description>
|
||||
[...implementation happening...]
|
||||
✓ Task complete
|
||||
|
||||
Working on task 4/7: <task description>
|
||||
[...implementation happening...]
|
||||
✓ Task complete
|
||||
```
|
||||
|
||||
**Output On Completion**
|
||||
|
||||
```
|
||||
## Implementation Complete
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Progress:** 7/7 tasks complete ✓
|
||||
|
||||
### Completed This Session
|
||||
- [x] Task 1
|
||||
- [x] Task 2
|
||||
...
|
||||
|
||||
All tasks complete! You can archive this change with `/opsx:archive`.
|
||||
```
|
||||
|
||||
**Output On Pause (Issue Encountered)**
|
||||
|
||||
```
|
||||
## Implementation Paused
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Progress:** 4/7 tasks complete
|
||||
|
||||
### Issue Encountered
|
||||
<description of the issue>
|
||||
|
||||
**Options:**
|
||||
1. <option 1>
|
||||
2. <option 2>
|
||||
3. Other approach
|
||||
|
||||
What would you like to do?
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
- Keep going through tasks until done or blocked
|
||||
- Always read context files before starting (from the apply instructions output)
|
||||
- If task is ambiguous, pause and ask before implementing
|
||||
- If implementation reveals issues, pause and suggest artifact updates
|
||||
- Keep code changes minimal and scoped to each task
|
||||
- Update task checkbox immediately after completing each task
|
||||
- Pause on errors, blockers, or unclear requirements - don't guess
|
||||
- Use contextFiles from CLI output, don't assume specific file names
|
||||
- Do not use context or operation guidance as proof that a task is complete
|
||||
- Apply relevant project context; report conflicts with controlling workflow inputs
|
||||
- Consider every guidance entry; explain any inapplicable or conflicting advice
|
||||
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
|
||||
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
|
||||
|
||||
**Fluid Workflow Integration**
|
||||
|
||||
This skill supports the "actions on a change" model:
|
||||
|
||||
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
||||
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
||||
@@ -0,0 +1,182 @@
|
||||
---
|
||||
name: openspec-archive-change
|
||||
description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
|
||||
allowed-tools: Bash(openspec:*)
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.8.0"
|
||||
---
|
||||
|
||||
Archive a completed change in the experimental workflow.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
||||
|
||||
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
||||
|
||||
When prompting, show only active changes (not already archived).
|
||||
Include the schema used for each change if available.
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:archive <other>`).
|
||||
|
||||
**Load current archive inputs before the existing archive checks:**
|
||||
|
||||
After resolving the selected change and planning root, run:
|
||||
```bash
|
||||
openspec instructions archive --change "<name>" --json
|
||||
```
|
||||
Keep the same selected-root flags on this command. This lookup is advisory and
|
||||
optional: it only supplies extra prompt inputs, so it must never block archiving.
|
||||
If it exits non-zero or returns invalid JSON — for example on an older CLI that
|
||||
does not support this command yet — continue the archive workflow with no
|
||||
context and no operation guidance. Do not report an error and do not stop.
|
||||
|
||||
A successful response may omit both optional fields. Treat `context` as a
|
||||
required prompt-level input: read and consider it, and apply relevant project
|
||||
facts, conventions, and constraints. Treat `operationGuidance` as optional
|
||||
additive advice: read and consider every entry, and follow entries that are
|
||||
applicable and compatible with the built-in archive workflow.
|
||||
|
||||
Keep both fields separate from built-in steps, explicit user choices, resolved
|
||||
paths, CLI checks, and command contracts. If context conflicts with one of those
|
||||
controlling inputs, report the conflict and preserve the controlling value. If
|
||||
guidance is inapplicable or conflicts with a controlling input, do not follow it
|
||||
and explain why. Do not infer replacement paths, skipped prompts, or flags from
|
||||
either field, and do not copy their text verbatim into specs, change artifacts,
|
||||
or archive summaries unless the user separately asks for it. These are
|
||||
prompt-level behavior contracts, not enforceable checks.
|
||||
|
||||
2. **Check artifact completion status**
|
||||
|
||||
Run `openspec status --change "<name>" --json` to check artifact completion.
|
||||
|
||||
Parse the JSON to understand:
|
||||
- `schemaName`: The workflow being used
|
||||
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
||||
- `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
|
||||
|
||||
**If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
|
||||
- Display warning listing incomplete artifacts
|
||||
- Ask the user to confirm they want to proceed
|
||||
- Proceed if user confirms
|
||||
|
||||
3. **Check task completion status**
|
||||
|
||||
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
||||
|
||||
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
||||
|
||||
**If incomplete tasks found:**
|
||||
- Display warning showing count of incomplete tasks
|
||||
- Ask the user to confirm they want to proceed
|
||||
- Proceed if user confirms
|
||||
|
||||
**If no tasks file exists:** Proceed without task-related warning.
|
||||
|
||||
4. **Assess delta spec sync state**
|
||||
|
||||
Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
|
||||
delta-spec source. If the `specs` entry is missing or
|
||||
`existingOutputPaths` is empty, proceed without a sync prompt and do not infer
|
||||
delta specs from other artifacts.
|
||||
|
||||
**If delta specs exist:**
|
||||
- Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)
|
||||
- Determine what changes would be applied (adds, modifications, removals, renames)
|
||||
- Show a combined summary before prompting
|
||||
|
||||
**Prompt options:**
|
||||
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
||||
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
||||
|
||||
Route on the answer:
|
||||
- "Cancel" — stop, do not archive
|
||||
- "Archive without syncing" or "Archive now" — proceed to archive
|
||||
- "Sync now" or "Sync anyway" — sync, then verify (below)
|
||||
- Anything else — ask again rather than archiving
|
||||
|
||||
Before a selected sync writes any main spec, run
|
||||
`openspec instructions specs --change "<name>" --json` once with the same
|
||||
selected-root flags. Require a zero exit status and valid artifact-instruction
|
||||
JSON. If the lookup fails or returns invalid JSON, report the error and stop
|
||||
before writing any main spec or moving the change. A valid response with omitted
|
||||
`rules` is the no-rules case. Apply returned `rules` only to the content and
|
||||
form of main specs produced by this merge; do not use them as archive guidance,
|
||||
change CLI behavior, or copy the rule text into any output file.
|
||||
|
||||
Then run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
|
||||
|
||||
Then re-run the comparison from the top of this step against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
|
||||
- ADDED requirements present
|
||||
- MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
|
||||
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
|
||||
- RENAMED requirements present under the new name and absent under the old one
|
||||
|
||||
If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
|
||||
|
||||
5. **Perform the archive**
|
||||
|
||||
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
|
||||
```bash
|
||||
mkdir -p "<planningHome.changesDir>/archive"
|
||||
```
|
||||
|
||||
Generate the target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
|
||||
|
||||
**Check if target already exists:**
|
||||
- If yes: Fail with error, suggest renaming existing archive or using different date
|
||||
- If no: Move `changeRoot` to the archive directory
|
||||
|
||||
```bash
|
||||
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
|
||||
```
|
||||
|
||||
6. **Display summary**
|
||||
|
||||
Show archive completion summary including:
|
||||
- Change name
|
||||
- Schema that was used
|
||||
- Archive location
|
||||
- Whether specs were synced (if applicable)
|
||||
- Note about any warnings (incomplete artifacts/tasks)
|
||||
|
||||
**Output On Success**
|
||||
|
||||
```markdown
|
||||
## Archive Complete
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
||||
**Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
|
||||
|
||||
<"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
- Announce the selected change; prompt for selection when it is ambiguous
|
||||
- Use artifact graph (openspec status --json) for completion checking
|
||||
- Don't block archive on warnings - just inform and confirm
|
||||
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
||||
- Show clear summary of what happened
|
||||
- If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven)
|
||||
- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
|
||||
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
||||
- Apply relevant runtime context and report conflicts; operation guidance remains advisory
|
||||
- Consider every guidance entry and explain any inapplicable or conflicting advice
|
||||
- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
|
||||
- Artifact rules constrain only the specs being written and are never operation guidance
|
||||
- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
|
||||
@@ -0,0 +1,308 @@
|
||||
---
|
||||
name: openspec-explore
|
||||
description: Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.
|
||||
allowed-tools: Bash(openspec:*)
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.8.0"
|
||||
---
|
||||
|
||||
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
|
||||
|
||||
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. For a new change, scaffold it first as described below.
|
||||
|
||||
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
---
|
||||
|
||||
## The Stance
|
||||
|
||||
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
||||
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
|
||||
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
||||
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
||||
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
||||
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
||||
|
||||
---
|
||||
|
||||
## What You Might Do
|
||||
|
||||
Depending on what the user brings, you might:
|
||||
|
||||
**Explore the problem space**
|
||||
- Ask clarifying questions that emerge from what they said
|
||||
- Challenge assumptions
|
||||
- Reframe the problem
|
||||
- Find analogies
|
||||
|
||||
**Investigate the codebase**
|
||||
- Map existing architecture relevant to the discussion
|
||||
- Find integration points
|
||||
- Identify patterns already in use
|
||||
- Surface hidden complexity
|
||||
|
||||
**Compare options**
|
||||
- Brainstorm multiple approaches
|
||||
- Build comparison tables
|
||||
- Sketch tradeoffs
|
||||
- Recommend a path (if asked)
|
||||
|
||||
**Visualize**
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ Use ASCII diagrams liberally │
|
||||
├─────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌────────┐ ┌────────┐ │
|
||||
│ │ State │────────▶│ State │ │
|
||||
│ │ A │ │ B │ │
|
||||
│ └────────┘ └────────┘ │
|
||||
│ │
|
||||
│ System diagrams, state machines, │
|
||||
│ data flows, architecture sketches, │
|
||||
│ dependency graphs, comparison tables │
|
||||
│ │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
**Surface risks and unknowns**
|
||||
- Identify what could go wrong
|
||||
- Find gaps in understanding
|
||||
- Suggest spikes or investigations
|
||||
|
||||
---
|
||||
|
||||
## OpenSpec Awareness
|
||||
|
||||
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
||||
|
||||
### Check for context
|
||||
|
||||
At the start, quickly check what exists:
|
||||
```bash
|
||||
openspec list --json
|
||||
```
|
||||
|
||||
This tells you:
|
||||
- If there are active changes
|
||||
- Their names, schemas, and status
|
||||
- What the user might be working on
|
||||
|
||||
Then read the project's own context from the resolved root - `<root.path>/openspec/config.yaml` (or `config.yml`). Use the `root.path` returned above, and skip this if neither file exists:
|
||||
- `context`: project background - tech stack, conventions, constraints
|
||||
- `rules`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
|
||||
|
||||
Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
|
||||
|
||||
### When no change exists
|
||||
|
||||
Think freely. When insights crystallize, you might offer:
|
||||
|
||||
- "This feels solid enough to start a change. Want me to create a proposal?"
|
||||
- Or keep exploring - no pressure to formalize
|
||||
|
||||
If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
|
||||
|
||||
1. Run `openspec new change "<name>"` (with `--store <id>` when applicable) before creating any artifacts. Never create a new change directory under `openspec/changes/` by hand; the CLI scaffold creates required metadata such as `.openspec.yaml`. Keep the selected `--store <id>` on every applicable follow-up `status` and `instructions` command.
|
||||
2. Run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is `ready`, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own `instruction` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run `openspec instructions "<prerequisite-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) for that prerequisite whether it is `ready` or `blocked`. If its own `instruction` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
|
||||
3. Follow the returned `template` and `instruction` fields. Read completed dependency files listed in `dependencies`, and apply `context` and `rules` as constraints without copying them into the artifact. If the instruction delegates creation to a specific skill or command, invoke it; otherwise write the artifact to `resolvedOutputPath`, using the instruction to choose a concrete path when it is a glob. Verify that the selected concrete output exists.
|
||||
4. After creating each artifact, re-run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) and continue until every requested artifact is `done`, `skipped`, or was deliberately skipped because its own `instruction` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still `blocked` only because you deliberately skipped a conditional prerequisite, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
|
||||
|
||||
Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status.
|
||||
|
||||
### When a change exists
|
||||
|
||||
If the user mentions a change or you detect one is relevant:
|
||||
|
||||
1. **Resolve and read existing artifacts for context**
|
||||
- Run `openspec status --change "<name>" --json`.
|
||||
- Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
|
||||
- Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
|
||||
|
||||
2. **Reference them naturally in conversation**
|
||||
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
||||
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
||||
|
||||
3. **Offer to capture when decisions are made**
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
|
||||
|
||||
| Insight Type | Where to Capture |
|
||||
|----------------------------|-------------------------------------|
|
||||
| New requirement discovered | `specs/<capability-path>/spec.md` |
|
||||
| Requirement changed | `specs/<capability-path>/spec.md` |
|
||||
| Design decision made | `design.md` |
|
||||
| Scope changed | `proposal.md` |
|
||||
| New work identified | `tasks.md` |
|
||||
| Assumption invalidated | Relevant artifact |
|
||||
|
||||
Example offers:
|
||||
- "That's a design decision. Capture it in design.md?"
|
||||
- "This is a new requirement. Add it to specs?"
|
||||
- "This changes scope. Update the proposal?"
|
||||
|
||||
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
||||
|
||||
---
|
||||
|
||||
## What You Don't Have To Do
|
||||
|
||||
- Follow a script
|
||||
- Ask the same questions every time
|
||||
- Produce a specific artifact
|
||||
- Reach a conclusion
|
||||
- Stay on topic if a tangent is valuable
|
||||
- Be brief (this is thinking time)
|
||||
|
||||
---
|
||||
|
||||
## Handling Different Entry Points
|
||||
|
||||
**User brings a vague idea:**
|
||||
```
|
||||
User: I'm thinking about adding real-time collaboration
|
||||
|
||||
You: Real-time collab is a big space. Let me think about this...
|
||||
|
||||
COLLABORATION SPECTRUM
|
||||
════════════════════════════════════════════
|
||||
|
||||
Awareness Coordination Sync
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌────────┐ ┌────────┐ ┌────────┐
|
||||
│Presence│ │Cursors │ │ CRDT │
|
||||
│ "3 │ │ Multi │ │Conflict│
|
||||
│online" │ │ select │ │ free │
|
||||
└────────┘ └────────┘ └────────┘
|
||||
│ │ │
|
||||
trivial moderate complex
|
||||
|
||||
Where's your head at?
|
||||
```
|
||||
|
||||
**User brings a specific problem:**
|
||||
```
|
||||
User: The auth system is a mess
|
||||
|
||||
You: [reads codebase]
|
||||
|
||||
┌─────────────────────────────────────────────┐
|
||||
│ CURRENT AUTH FLOW │
|
||||
└─────────────────────────────────────────────┘
|
||||
│
|
||||
┌─────────────┼─────────────┐
|
||||
▼ ▼ ▼
|
||||
┌─────────┐ ┌─────────┐ ┌─────────┐
|
||||
│ Google │ │ GitHub │ │ Email │
|
||||
│ OAuth │ │ OAuth │ │ Magic │
|
||||
└────┬────┘ └────┬────┘ └────┬────┘
|
||||
│ │ │
|
||||
└─────────────┼─────────────┘
|
||||
▼
|
||||
┌───────────┐
|
||||
│ Session │
|
||||
└─────┬─────┘
|
||||
│
|
||||
▼
|
||||
┌───────────┐
|
||||
│ Perms │
|
||||
└───────────┘
|
||||
|
||||
I see three tangles. Which one's burning?
|
||||
```
|
||||
|
||||
**User is stuck mid-implementation:**
|
||||
```
|
||||
User: /opsx:explore add-auth-system
|
||||
The OAuth integration is more complex than expected
|
||||
|
||||
You: [reads change artifacts]
|
||||
|
||||
You're on task 4: "Implement OAuth flow"
|
||||
|
||||
Let me trace what's involved...
|
||||
|
||||
[draws diagram, explores options, suggests paths]
|
||||
|
||||
Want to update the design to reflect this?
|
||||
Or add a spike task to investigate?
|
||||
```
|
||||
|
||||
**User wants to compare options:**
|
||||
```
|
||||
User: Should we use Postgres or SQLite?
|
||||
|
||||
You: Generic answer is boring. What's the context?
|
||||
|
||||
User: A CLI tool that tracks local dev environments
|
||||
|
||||
You: That changes everything.
|
||||
|
||||
┌─────────────────────────────────────────────────┐
|
||||
│ CLI TOOL DATA STORAGE │
|
||||
└─────────────────────────────────────────────────┘
|
||||
|
||||
Key constraints:
|
||||
• No daemon running
|
||||
• Must work offline
|
||||
• Single user
|
||||
|
||||
SQLite Postgres
|
||||
Deployment embedded ✓ needs server ✗
|
||||
Offline yes ✓ no ✗
|
||||
Single file yes ✓ no ✗
|
||||
|
||||
SQLite. Not even close.
|
||||
|
||||
Unless... is there a sync component?
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Ending Discovery
|
||||
|
||||
There's no required ending. Discovery might:
|
||||
|
||||
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
|
||||
- **Result in artifact updates**: "Updated design.md with these decisions"
|
||||
- **Just provide clarity**: User has what they need, moves on
|
||||
- **Continue later**: "We can pick this up anytime"
|
||||
|
||||
When it feels like things are crystallizing, you might summarize:
|
||||
|
||||
```
|
||||
## What We Figured Out
|
||||
|
||||
**The problem**: [crystallized understanding]
|
||||
|
||||
**The approach**: [if one emerged]
|
||||
|
||||
**Open questions**: [if any remain]
|
||||
|
||||
**Next steps** (if ready):
|
||||
- Create a change proposal
|
||||
- Keep exploring: just keep talking
|
||||
```
|
||||
|
||||
But this summary is optional. Sometimes the thinking IS the value.
|
||||
|
||||
---
|
||||
|
||||
## Guardrails
|
||||
|
||||
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
|
||||
- **Don't fake understanding** - If something is unclear, dig deeper
|
||||
- **Don't rush** - Discovery is thinking time, not task time
|
||||
- **Don't force structure** - Let patterns emerge naturally
|
||||
- **Don't auto-capture** - Offer to save insights, don't just do it
|
||||
- **Don't manually scaffold changes** - Never create a new change directory under `openspec/changes/` by hand. Always use `openspec new change "<name>"` (with `--store <id>` when applicable) so required metadata such as `.openspec.yaml` is created before writing artifacts.
|
||||
- **Do visualize** - A good diagram is worth many paragraphs
|
||||
- **Do explore the codebase** - Ground discussions in reality
|
||||
- **Do question assumptions** - Including the user's and your own
|
||||
@@ -0,0 +1,149 @@
|
||||
---
|
||||
name: openspec-propose
|
||||
description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
|
||||
allowed-tools: Bash(openspec:*)
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.8.0"
|
||||
---
|
||||
|
||||
Propose a new change - create the change and generate all artifacts in one step.
|
||||
|
||||
**Planning boundary**: This workflow creates planning artifacts only. The user request that selected or triggered this workflow authorizes planning only, even if it asks to build or fix something. Do not edit project code. After the planning artifacts are complete, stop. Do not start implementation in the same response, even if the initial request asks for it. Wait for a new user request after the artifacts are presented; then start the apply workflow.
|
||||
|
||||
I'll create a change with the artifacts your schema defines. With the default spec-driven schema that is:
|
||||
- proposal.md (what & why)
|
||||
- `specs/<capability-path>/spec.md` (what the system must do - a delta, not the main spec)
|
||||
- design.md (how)
|
||||
- tasks.md (implementation steps)
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
|
||||
|
||||
When the user is ready to implement, they must start the apply workflow explicitly.
|
||||
|
||||
---
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Understand the request and clarify material ambiguity**
|
||||
|
||||
If no clear input is provided, ask the user (open-ended, no preset options):
|
||||
> "What change do you want to work on? Describe what you want to build or fix."
|
||||
|
||||
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
|
||||
|
||||
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
||||
|
||||
If the request contains ambiguity that would materially affect scope, externally observable behavior, compatibility, or acceptance criteria, ask the user before creating the change. For minor details, make a reasonable assumption and record it in the planning artifacts.
|
||||
|
||||
2. **Determine the workflow schema**
|
||||
|
||||
Use the configured default schema unless the user explicitly requests a different workflow.
|
||||
|
||||
**Use a different schema only if the user:**
|
||||
- Explicitly requests a specific schema by name → use `--schema <schema-name>`
|
||||
- Asks to "show workflows" or asks "what workflows" exist → resolve the authoritative root by running `openspec context --json` from the current working directory. If the user explicitly selected a registered store, use `openspec context --json --store "<store-id>"`. Then run `openspec schemas --json` with its working directory set to the returned `root.path` and let them choose. This preserves roots selected by a local `store:` pointer or the global `defaultStore`; `schemas` does not accept `--store`. If context reports only `no_openspec_root`, run `openspec schemas --json` from the current working directory instead. Do not use this fallback for invalid or unavailable stores.
|
||||
|
||||
Otherwise, omit `--schema` to preserve the configured default.
|
||||
|
||||
3. **Create the change directory**
|
||||
|
||||
Choose one schema form below. If a registered store is selected, append `--store "<store-id>"` to that command and each later OpenSpec command shown below that accepts `--store`.
|
||||
|
||||
Using the configured default:
|
||||
```bash
|
||||
openspec new change "<name>"
|
||||
```
|
||||
|
||||
Using an explicitly requested schema:
|
||||
```bash
|
||||
openspec new change "<name>" --schema "<schema-name>"
|
||||
```
|
||||
This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
|
||||
|
||||
4. **Get the artifact build order**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
Parse the JSON to get:
|
||||
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
||||
- `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
|
||||
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
||||
|
||||
5. **Create every artifact in the required set**
|
||||
|
||||
Use a todo list to track progress through the artifacts.
|
||||
|
||||
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
|
||||
|
||||
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
||||
- Get instructions:
|
||||
```bash
|
||||
openspec instructions <artifact-id> --change "<name>" --json
|
||||
```
|
||||
- The instructions JSON includes:
|
||||
- `context`: Project background (constraints for you - do NOT include in output)
|
||||
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
|
||||
- `template`: The structure to use for your output file
|
||||
- `instruction`: Schema-specific guidance for this artifact type
|
||||
- `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
|
||||
- `resolvedOutputPath`: Resolved path or pattern to write the artifact
|
||||
- `dependencies`: Completed artifacts to read for context
|
||||
- Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
|
||||
- If the `instruction` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at `resolvedOutputPath`
|
||||
- Otherwise create the artifact file using `template` as the structure and write it to `resolvedOutputPath`. If `resolvedOutputPath` is a glob, follow `instruction` to choose the concrete file path
|
||||
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
|
||||
- Show brief progress: "Created <artifact-id>"
|
||||
|
||||
b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
|
||||
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
||||
- The required set is `applyRequires` plus every artifact reachable from those by following the `requires` edges in `status --json` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
|
||||
- `status` is file-existence only, so an `applyRequires` artifact reading `done` does NOT mean its dependencies exist - writing `tasks.md` early marks `tasks` done while `specs` was never written. Use each artifact's `requires` edges, not its `status`, to build the required set: a `done` artifact still lists what it depends on
|
||||
- An artifact already reading `status: "skipped"` is satisfied: the change declares `skip_specs` in `.openspec.yaml`, so its files must NOT exist. Never try to create one
|
||||
- Create every artifact in the required set that is missing, then re-check - creating one can unblock others
|
||||
- Skip one only when `status` already reports it `skipped`, or when its own `instruction` says it is conditional: run `openspec instructions <artifact-id> --change "<name>" --json` and skip only if its `instruction` field marks it optional (e.g. "create only if..."). Spec-driven's `design.md` qualifies; `specs` qualifies only via the `skipped` status above, never by your own judgment. Tell the user, and do not reconsider it
|
||||
- Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
|
||||
- Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
|
||||
|
||||
c. **If an artifact requires user input** (unclear context):
|
||||
- Ask the user to clarify
|
||||
- Then continue with creation
|
||||
|
||||
6. **Show final status**
|
||||
```bash
|
||||
openspec status --change "<name>"
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
After completing all artifacts, summarize:
|
||||
- Change name and location
|
||||
- List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
|
||||
- What's ready: "All artifacts needed for implementation are ready."
|
||||
- Prompt: "The artifacts are ready for review. When you are ready, run `/opsx:apply` or ask me to apply this change."
|
||||
|
||||
**Artifact Creation Guidelines**
|
||||
|
||||
- Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
|
||||
- If the `instruction` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
|
||||
- The schema defines what each artifact should contain - follow it
|
||||
- Read dependency artifacts for context before creating new ones
|
||||
- Use `template` as the structure for your output file - fill in its sections
|
||||
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
|
||||
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
|
||||
- These guide what you write, but should never appear in the output
|
||||
|
||||
**Guardrails**
|
||||
- The request that invoked this workflow authorizes planning only. Any implementation or apply instruction in that request does not carry forward. Do NOT implement the change, start the apply workflow, or edit project code during this workflow. After presenting the artifacts, stop and wait for a new user request to start the apply workflow
|
||||
- Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
|
||||
- Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
|
||||
- Ask about ambiguities that would materially change scope, externally observable behavior, compatibility, or acceptance criteria; for minor details, make reasonable assumptions and record them
|
||||
- If a change with that name already exists, ask if user wants to continue it or create a new one
|
||||
- Verify each artifact file exists after writing before proceeding to next
|
||||
@@ -0,0 +1,262 @@
|
||||
---
|
||||
name: openspec-sync-specs
|
||||
description: Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.
|
||||
allowed-tools: Bash(openspec:*)
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.8.0"
|
||||
---
|
||||
|
||||
Sync delta specs from a change to main specs.
|
||||
|
||||
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
||||
|
||||
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
||||
|
||||
When prompting, show changes that have delta specs (under `specs/` directory).
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:sync <other>`).
|
||||
|
||||
2. **Resolve change context**
|
||||
|
||||
Run:
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
|
||||
The JSON includes `planningHome.root`. Main specs live under `<planningHome.root>/openspec/specs/` — use that (store-aware) root for every main-spec path below, not a hardcoded repo path. When a store is selected it points at the store, not the current repository.
|
||||
|
||||
3. **Find delta specs**
|
||||
|
||||
Use `artifactPaths.specs.existingOutputPaths` from the status JSON as the
|
||||
only source of delta spec paths. If the `specs` entry is missing or
|
||||
`existingOutputPaths` is empty, report that there are no delta specs to sync,
|
||||
do not infer them from other artifacts, and stop without requesting artifact
|
||||
instructions or writing a main spec.
|
||||
|
||||
Sync every path in `existingOutputPaths` unless the caller narrowed the set.
|
||||
A caller narrows it by naming an explicit list of complete entries from
|
||||
`existingOutputPaths` — copy those absolute values verbatim. Archive does
|
||||
this inline, and a user can too (for example, by selecting the entry ending
|
||||
in `/specs/billing/invoices/spec.md`).
|
||||
Then sync only the named paths and leave the remaining delta specs untouched:
|
||||
bulk archive excludes a delta whose implementation it could not find, and
|
||||
syncing it anyway would write a main spec the caller deliberately withheld.
|
||||
Carry that narrowed selection through step 4; never widen it back to the full
|
||||
list. If a named path is not in `existingOutputPaths`, do not sync it —
|
||||
report it and stop, rather than dropping it silently. If the named list is
|
||||
empty, report that there is nothing to sync and stop without writing a main
|
||||
spec.
|
||||
|
||||
Each delta spec file contains sections like:
|
||||
- `## ADDED Requirements` - New requirements to add
|
||||
- `## MODIFIED Requirements` - Changes to existing requirements
|
||||
- `## REMOVED Requirements` - Requirements to remove
|
||||
- `## RENAMED Requirements` - Requirements to rename (FROM:/TO: format)
|
||||
|
||||
If no delta specs found, inform user and stop.
|
||||
|
||||
4. **For each delta spec, apply changes to main specs**
|
||||
|
||||
Before the first main-spec write, obtain one current specs-rule snapshot:
|
||||
- If archive invoked this workflow inline and supplied a valid snapshot from
|
||||
`openspec instructions specs --change "<name>" --json`, reuse it and do not
|
||||
fetch the same instructions again.
|
||||
- Otherwise run that command once now with the same selected-root flags.
|
||||
- If the direct lookup exits non-zero or returns invalid artifact-instruction
|
||||
JSON, report the error and stop before writing any main spec. Do not treat the
|
||||
failure as an absent rule set.
|
||||
- A valid response with omitted `rules` means no artifact rules are configured
|
||||
and the existing semantic merge continues.
|
||||
|
||||
Apply returned `rules` only to the content and form of the main specs produced
|
||||
by this merge. Artifact rules are not operation guidance and cannot change
|
||||
selected roots, delta paths, CLI checks, or workflow steps. Use their text as
|
||||
constraints without copying it verbatim into a main spec or summary.
|
||||
|
||||
For each capability delta spec path selected in step 3 — the full `existingOutputPaths` list, or the narrowed subset when a caller supplied one (these may belong to a selected store, not the repo):
|
||||
|
||||
a. **Read the delta spec** to understand the intended changes
|
||||
|
||||
b. **Read the main spec** at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (may not exist yet)
|
||||
|
||||
c. **Apply changes intelligently**:
|
||||
|
||||
**ADDED Requirements:**
|
||||
- If requirement doesn't exist in main spec → add it
|
||||
- If requirement already exists → update it to match (treat as implicit MODIFIED)
|
||||
|
||||
**MODIFIED Requirements:**
|
||||
- Find the requirement in main spec
|
||||
- Apply the changes - this can be:
|
||||
- Adding new scenarios the main spec does not have yet
|
||||
- Modifying existing scenarios
|
||||
- Changing the requirement description
|
||||
- Preserve scenarios/content not mentioned in the delta
|
||||
|
||||
**REMOVED Requirements:**
|
||||
- Remove the entire requirement block from main spec
|
||||
- Retiring the capability. Delete the whole `spec.md` - and the directory once
|
||||
nothing else is left in it - only when ALL of these hold:
|
||||
1. removing the requirements *this run* left no requirement blocks;
|
||||
2. the rest of the spec is well-formed (it still has a `## Purpose`);
|
||||
3. the main spec was not already empty before this sync - if you removed
|
||||
nothing, change nothing;
|
||||
4. every other nonblank line in the whole file is accounted for as the
|
||||
title, Purpose, Requirements header, or a canonical requirement's
|
||||
statement, scenarios, or fenced examples;
|
||||
5. the change's `.openspec.yaml` declares `retire_capabilities: true`;
|
||||
6. the `spec.md` resolves inside the real specs root (do not follow a
|
||||
capability-directory symlink to delete an external file).
|
||||
If removing the selected requirements would leave no requirement blocks and
|
||||
any retirement condition is not satisfied, do not modify the main spec. Stop
|
||||
the sync for that capability, report the blocking condition, and tell the user
|
||||
how to resolve it. Never write or leave an empty `## Requirements` section.
|
||||
When only the marker is missing, say that too - it is the one thing the user
|
||||
can add to make the retirement go through.
|
||||
- Deleting the file also deletes its `## Purpose`; any other section blocks
|
||||
retirement. Name Purpose when you report the retirement. Include a pasteable
|
||||
`git checkout` only when the spec lived in the caller's checkout;
|
||||
otherwise give checkout-scoped recovery guidance.
|
||||
|
||||
**RENAMED Requirements:**
|
||||
- Find the FROM requirement, rename to TO
|
||||
|
||||
**`## Purpose` in the delta:**
|
||||
- The main spec already has one and it is authoritative - leave it alone
|
||||
(this is what `openspec archive` does; it warns and moves on)
|
||||
|
||||
d. **Create new main spec** if capability doesn't exist yet:
|
||||
- Create `<planningHome.root>/openspec/specs/<capability-path>/spec.md`
|
||||
- Add Purpose section: copy the delta's `## Purpose` body verbatim when it has one
|
||||
(this is what `openspec archive` does); only write a brief TBD placeholder when it does not
|
||||
- Add Requirements section with the ADDED requirements
|
||||
- Follow the **Main Spec Format Reference** below
|
||||
|
||||
5. **Validate updated main specs**
|
||||
|
||||
Run `openspec validate --specs` with the same selected-root flags used earlier.
|
||||
If validation fails, report the problems and do not claim the sync succeeded.
|
||||
|
||||
6. **Show summary**
|
||||
|
||||
After applying all changes, summarize:
|
||||
- Which capabilities were updated
|
||||
- What changes were made (requirements added/modified/removed/renamed)
|
||||
- Any new main spec left with a TBD Purpose placeholder, so it gets written
|
||||
now rather than lingering
|
||||
- Any capability retired, naming the deleted `spec.md`, its Purpose, and
|
||||
either a pasteable `git checkout` or checkout-scoped recovery guidance
|
||||
|
||||
**Delta Spec Format Reference**
|
||||
|
||||
```markdown
|
||||
## Purpose
|
||||
|
||||
Only on a delta that introduces a brand-new capability. Seeds the new main spec.
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: New Feature
|
||||
The system SHALL do something new.
|
||||
|
||||
#### Scenario: Basic case
|
||||
- **WHEN** user does X
|
||||
- **THEN** system does Y
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Existing Feature
|
||||
The system SHALL keep doing the existing thing, now also handling A.
|
||||
|
||||
#### Scenario: Scenario the main spec already has
|
||||
- **WHEN** user does X
|
||||
- **THEN** system does Y
|
||||
|
||||
#### Scenario: New scenario to add
|
||||
- **WHEN** user does A
|
||||
- **THEN** system does B
|
||||
|
||||
## REMOVED Requirements
|
||||
|
||||
### Requirement: Deprecated Feature
|
||||
|
||||
## RENAMED Requirements
|
||||
|
||||
- FROM: `### Requirement: Old Name`
|
||||
- TO: `### Requirement: New Name`
|
||||
```
|
||||
|
||||
**Main Spec Format Reference**
|
||||
|
||||
Main specs are what the delta merges INTO. They must never contain delta operation headers (`## ADDED/MODIFIED/REMOVED/RENAMED Requirements`) - after syncing, every requirement lives under a single `## Requirements` section:
|
||||
|
||||
```markdown
|
||||
# <capability> Specification
|
||||
|
||||
## Purpose
|
||||
Short description of what this capability does and why it exists.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Requirement: New Feature
|
||||
The system SHALL do something new.
|
||||
|
||||
#### Scenario: Basic case
|
||||
- **WHEN** user does X
|
||||
- **THEN** system does Y
|
||||
```
|
||||
|
||||
**Key Principle: Intelligent Merging**
|
||||
|
||||
Unlike programmatic merging, you merge rather than overwrite:
|
||||
- A MODIFIED block carries the whole requirement - body plus every scenario that survives the change. `openspec validate` and `openspec archive` both reject one that drops a scenario the main spec still has.
|
||||
- Keep anything the delta does not mention, in the main spec's existing order
|
||||
- Use your judgment to merge changes sensibly
|
||||
|
||||
**Output On Success**
|
||||
|
||||
```markdown
|
||||
## Specs Synced: <change-name>
|
||||
|
||||
Updated main specs:
|
||||
|
||||
**<capability-1>**:
|
||||
- Added requirement: "New Feature"
|
||||
- Modified requirement: "Existing Feature" (added 1 scenario)
|
||||
|
||||
**<capability-2>**:
|
||||
- Created new spec file
|
||||
- Added requirement: "Another Feature"
|
||||
|
||||
Main specs are now updated. The change remains active - archive when implementation is complete.
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
- Read both delta and main specs before making changes
|
||||
- Preserve existing content not mentioned in delta
|
||||
- Never copy a delta file into a main spec as-is - merge its content so the main spec keeps the Main Spec Format Reference structure, with no delta operation headers
|
||||
- If something is unclear, ask for clarification
|
||||
- Show what you're changing as you go
|
||||
- The operation should be idempotent - running twice should give same result
|
||||
- Use only `artifactPaths.specs.existingOutputPaths`; never infer delta specs from unrelated artifacts
|
||||
- Honor a caller-supplied subset of `existingOutputPaths`; never widen it back to the full list
|
||||
- Fetch specs instructions once for direct sync, or reuse the archive-supplied snapshot inline
|
||||
- Stop before every main-spec write on a non-zero or invalid JSON specs-instruction response
|
||||
- Artifact rules constrain only the specs being written and are never copied into output files
|
||||
@@ -0,0 +1,91 @@
|
||||
---
|
||||
name: openspec-update-change
|
||||
description: Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.
|
||||
allowed-tools: Bash(openspec:*)
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.8.0"
|
||||
---
|
||||
|
||||
Revise a change's existing planning artifacts and keep them coherent. Never edit code.
|
||||
|
||||
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
||||
|
||||
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
`/opsx:continue` is an expanded-profile workflow and may not be installed. Before suggesting it anywhere below, verify that it is available. If it is unavailable, `openspec status --change "<name>" --json` shows the next artifact and `openspec instructions "<artifact-id>" --change "<name>" --json` explains how to create it.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
|
||||
|
||||
When prompting, present the top 3-4 most recently modified changes as options, showing:
|
||||
- Change name
|
||||
- Schema (from `schema` field if present, otherwise "spec-driven")
|
||||
- Status (e.g., "0/5 tasks", "complete", "no tasks")
|
||||
- How recently it was modified (from `lastModified` field)
|
||||
|
||||
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:update <other>`).
|
||||
|
||||
2. **Get the change's artifacts**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
Parse the JSON to understand current state. The response includes:
|
||||
- `schemaName`: The workflow schema being used (e.g., "spec-driven")
|
||||
- `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
|
||||
- `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
|
||||
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
||||
|
||||
The artifact ids and paths come from the active schema - do NOT assume them, and do NOT branch on hardcoded artifact names. Custom schemas must work unchanged.
|
||||
|
||||
The files to edit are `artifactPaths.<id>.existingOutputPaths` - the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. `specs/**/*.md`). Do NOT write to `resolvedOutputPath`: for a glob artifact it is still the glob pattern, not a real file.
|
||||
|
||||
3. **Understand the request**
|
||||
- If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
|
||||
- If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
|
||||
|
||||
4. **Read and reconcile**
|
||||
- Read the artifact(s) the request touches and the change's other existing artifacts.
|
||||
- Apply the requested edit. Then check every other existing artifact against it - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
|
||||
- Note everything that is now inconsistent, missing, or contradictory.
|
||||
- Revise only files that already exist (`existingOutputPaths`). Do NOT create artifacts that don't exist yet, and do NOT invent new files under a glob artifact - note them and point the user to `/opsx:continue` to create them.
|
||||
- If the change is already coherent, say so and make no edits.
|
||||
|
||||
5. **Confirm and apply, one artifact at a time**
|
||||
- Show each proposed revision and why. Write only after the user confirms.
|
||||
- If the user rejects a revision, do not write it - leave that artifact unchanged.
|
||||
- When a substantial rewrite is needed, get that artifact's rules and template first:
|
||||
```bash
|
||||
openspec instructions "<artifact-id>" --change "<name>" --json
|
||||
```
|
||||
|
||||
6. **Point to the next step (guidance only - NEVER act on it)**
|
||||
- Artifacts still missing -> suggest `/opsx:continue` to create them.
|
||||
- Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `/opsx:apply` to carry the delta into code.
|
||||
- Everything done and implemented -> suggest `/opsx:archive`.
|
||||
|
||||
**Output**
|
||||
|
||||
After each invocation, show:
|
||||
- Which artifacts were revised (and which proposed revisions were rejected)
|
||||
- Anything deferred to `/opsx:continue` (not-yet-created artifacts or files)
|
||||
- Where the change stands and the recommended next command
|
||||
|
||||
**Guardrails**
|
||||
- Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/opsx:apply`.
|
||||
- Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
|
||||
- Edit only the concrete files in `existingOutputPaths`; never write to a glob `resolvedOutputPath`.
|
||||
- Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is `/opsx:continue`'s job.
|
||||
- Confirm every edit with the user before writing.
|
||||
- If the request changes the change's *intent* rather than refining it, first verify whether the expanded-profile `/opsx:new` workflow is available. If it is, recommend starting fresh with `/opsx:new` (the "Update vs. Start Fresh" heuristic). If it is unavailable, ask for a distinct unused change name and recommend `openspec new change "<new-change-name>"` instead.
|
||||
@@ -14,7 +14,33 @@ backups
|
||||
*.pfx
|
||||
*.jks
|
||||
.venv
|
||||
venv
|
||||
__pycache__
|
||||
*.pyc
|
||||
*.pyo
|
||||
.pytest_cache
|
||||
.ruff_cache
|
||||
.mypy_cache
|
||||
.ty_cache
|
||||
node_modules
|
||||
evidence
|
||||
openspec
|
||||
student-tests
|
||||
tests
|
||||
scripts
|
||||
examples
|
||||
contracts
|
||||
infra
|
||||
*.md
|
||||
!README.md
|
||||
Makefile
|
||||
Dockerfile*
|
||||
compose*.yaml
|
||||
.dockerignore
|
||||
.gitignore
|
||||
.DS_Store
|
||||
lab.json
|
||||
requirements-dev.txt
|
||||
.claude
|
||||
|
||||
.verification/
|
||||
|
||||
@@ -23,3 +23,64 @@ WORKER_CONCURRENCY=2
|
||||
JOB_MAX_ATTEMPTS=5
|
||||
JOB_TIMEOUT_SECONDS=60
|
||||
STAGING_RETENTION_SECONDS=86400
|
||||
# Solution-specific: published LB ports, replica limits, workers and pool per replica,
|
||||
# LB queue per replica, drain window before closing the listener on SIGTERM, PostgreSQL
|
||||
# limits, load generator limits (profile bench), cursor key file. API_PORT/SHORTTTL_PORT of lab2 are gone:
|
||||
# only the load balancer is published.
|
||||
LB_HTTP_PORT=18085
|
||||
LB_STATS_PORT=25085
|
||||
API_CPUS=1
|
||||
API_MEMORY=512m
|
||||
WEB_CONCURRENCY=2
|
||||
DB_POOL_MAX_SIZE=8
|
||||
API_SERVER_MAXCONN=64
|
||||
DRAIN_SECONDS=2
|
||||
PG_MAX_CONNECTIONS=200
|
||||
PG_CPUS=2
|
||||
PG_MEMORY=1g
|
||||
K6_CPUS=2
|
||||
K6_MEMORY=512m
|
||||
CURSOR_SECRET_FILE=/run/secrets/cursor_secret
|
||||
# Solution-specific for lab4: S3 client timeouts (connect + read, two attempts stay below
|
||||
# REQUEST_TIMEOUT_SECONDS=8), parallel image checks per worker, RustFS memory limit.
|
||||
S3_CONNECT_TIMEOUT_SECONDS=1
|
||||
S3_READ_TIMEOUT_SECONDS=2
|
||||
IMAGE_CHECK_CONCURRENCY=2
|
||||
S3_MEMORY=512m
|
||||
# Solution-specific for lab4 grade 4: upload bodies buffered at once per worker, grace period
|
||||
# before an abandoned pending upload is swept, sweep interval and rows per sweep pass.
|
||||
UPLOAD_CONCURRENCY=3
|
||||
UPLOAD_GRACE_SECONDS=900
|
||||
UPLOAD_SWEEP_INTERVAL_SECONDS=30
|
||||
UPLOAD_SWEEP_BATCH=100
|
||||
# Fixed glibc mmap threshold for the API: buffers above 128 KiB are returned to the system on free.
|
||||
MALLOC_MMAP_THRESHOLD_=131072
|
||||
# Solution-specific for lab5: RabbitMQ management UI on 127.0.0.1, backoff base of a transient
|
||||
# retry (doubles per attempt up to 60 s), relay poll and sweep intervals, worker limits and the
|
||||
# PostgreSQL pool of relay and worker. FAULT_POINT is set only by infra/compose.faults.yaml.
|
||||
BROKER_MANAGEMENT_PORT=25086
|
||||
JOB_BACKOFF_BASE_SECONDS=2
|
||||
OUTBOX_POLL_SECONDS=1
|
||||
SWEEP_INTERVAL_SECONDS=5
|
||||
WORKER_CPUS=2
|
||||
WORKER_MEMORY=1g
|
||||
PIPELINE_DB_POOL_MAX_SIZE=4
|
||||
# Solution-specific for lab5 grade 4: render time per job (the render process is killed after it),
|
||||
# address space of one render process (WORKER_MEMORY >= WORKER_CONCURRENCY * RENDER_MEMORY_MB plus
|
||||
# ~120 MiB of the worker itself), jobs per render process before it is replaced.
|
||||
RENDER_TIMEOUT_SECONDS=30
|
||||
RENDER_MEMORY_MB=448
|
||||
RENDER_TASKS_PER_CHILD=100
|
||||
# Minimal client transfer rate, bytes/s: every body byte moved in either direction extends the
|
||||
# request deadline by 1/rate, so slow but steady uploads and downloads outlive REQUEST_TIMEOUT_SECONDS.
|
||||
MIN_TRANSFER_RATE_BYTES=131072
|
||||
# Solution-specific for lab4 track 2: limits of the one-off reconciler (profile reconcile), its S3
|
||||
# read timeout for listing pages, optional CPU pinning of the measured services (empty = no pinning)
|
||||
# and the CPU limit of RustFS (make reconcile-cost raises it with its memory for the 100k point).
|
||||
RECONCILE_CPUS=1
|
||||
RECONCILE_MEMORY=256m
|
||||
RECONCILE_S3_READ_TIMEOUT_SECONDS=10
|
||||
RECONCILE_CPUSET=
|
||||
S3_CPUSET=
|
||||
PG_CPUSET=
|
||||
S3_CPUS=1
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
name: Application
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
name: Линт, типы и собственные тесты
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
- run: uv sync --locked --group dev
|
||||
- run: make lint VENV=.venv
|
||||
- run: make student-test VENV=.venv
|
||||
|
||||
acceptance:
|
||||
name: Стенд Compose с RabbitMQ, relay и worker за HAProxy, smoke, pipeline, отказ реплики, рестарт и отказы зависимостей
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
- run: uv sync --locked --group dev
|
||||
|
||||
- name: Поднять стенд из чистого clone
|
||||
run: make up
|
||||
|
||||
- name: Публичный smoke через балансировщик
|
||||
run: make test
|
||||
|
||||
- name: Топология брокера, consumer с prefetch и права клиентов
|
||||
run: make topology
|
||||
|
||||
- name: Уровни «3» и «4» pipeline — worker остановлен, рестарт брокера, дубль, S3, попытки, варианты и пределы, падения в окнах 2–5, аренда, replay, DLQ, jitter, retention
|
||||
run: |
|
||||
make suite-preflight
|
||||
make level4
|
||||
|
||||
- name: Сообщение задания в очереди, 409 до ready и SIGTERM relay и worker
|
||||
run: make pipeline-evidence
|
||||
|
||||
- name: Вложение после остановки принявшей его реплики и при недоступном S3
|
||||
run: |
|
||||
make scenario SCENARIO=failover-upload
|
||||
make scenario SCENARIO=s3-outage
|
||||
|
||||
- name: Приватный bucket, ограниченный ключ API и повторный bootstrap
|
||||
run: make s3-check
|
||||
|
||||
- name: Негативный suite вложений, компенсация, уборка после grace, обрыв и зависание загрузки
|
||||
run: make upload-faults
|
||||
|
||||
- name: Несколько реплик на одном токене и гонка одного ключа
|
||||
run: make lb-check
|
||||
|
||||
- name: Повтор неподтверждённой записи после потерянного ответа и убитой реплики
|
||||
run: make retry-check
|
||||
|
||||
- name: Остановка реплики под запросами, затем возврат
|
||||
run: |
|
||||
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
docker compose ps -a api
|
||||
make restore
|
||||
|
||||
- name: Рестарт LB, API и хранилищ с сохранением volumes
|
||||
run: make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
|
||||
- name: Отказы Valkey и PostgreSQL, гонка и rollback
|
||||
run: make test-faults
|
||||
|
||||
- name: Лимиты, порты, секреты, volumes и сети по политике
|
||||
run: make limits
|
||||
|
||||
- name: Время обнаружения отказа балансировщиком (SIGTERM, kill, pause, PostgreSQL)
|
||||
run: make detection
|
||||
|
||||
- name: Наружу опубликован только балансировщик
|
||||
run: |
|
||||
docker compose ps --format '{{.Service}} {{.Ports}}' | awk '$2 != "" && $1 != "lb" && $1 != "broker" {print; bad=1} END {exit bad}'
|
||||
docker compose ps --format '{{.Service}} {{.Ports}}' | awk '$1 == "broker" && $2 !~ /^127\.0\.0\.1:/ {print; bad=1} END {exit bad}'
|
||||
|
||||
- name: Процессы работают не от root
|
||||
run: |
|
||||
for id in $(docker compose ps -q); do
|
||||
docker top "$id" -eo pid,uid,comm | awk 'NR>1 && $2==0 {print; bad=1} END {exit bad}' || exit 1
|
||||
done
|
||||
|
||||
- name: Одноразовые сервисы не от root
|
||||
run: |
|
||||
for service in migrate s3-init; do
|
||||
user=$(docker inspect -f '{{.Config.User}}' "$(docker compose ps -aq "$service")")
|
||||
echo "$service: $user"
|
||||
case "${user%%:*}" in ""|0|root) exit 1 ;; esac
|
||||
done
|
||||
|
||||
- name: Корректная остановка relay и worker по SIGTERM
|
||||
run: |
|
||||
start=$(date +%s)
|
||||
docker compose stop -t 10 relay worker
|
||||
elapsed=$(( $(date +%s) - start ))
|
||||
codes=$(docker inspect -f '{{.State.ExitCode}}' $(docker compose ps -aq relay worker) | sort -u)
|
||||
echo "остановка за ${elapsed} с, коды завершения ${codes}"
|
||||
test "$elapsed" -le 10 && test "$codes" = "0"
|
||||
|
||||
- name: Корректная остановка реплик API по SIGTERM
|
||||
run: |
|
||||
start=$(date +%s)
|
||||
docker compose kill --signal SIGTERM api
|
||||
codes=$(docker wait $(docker compose ps -aq api) | sort -u)
|
||||
elapsed=$(( $(date +%s) - start ))
|
||||
echo "остановка за ${elapsed} с, коды завершения ${codes}"
|
||||
test "$elapsed" -le 10 && test "$codes" = "0"
|
||||
|
||||
- name: Журналы стенда
|
||||
if: always()
|
||||
run: docker compose logs --tail 80
|
||||
+10
@@ -30,3 +30,13 @@ coverage/
|
||||
.vscode/
|
||||
# Keep small, sanitized evidence summaries in evidence/ under version control.
|
||||
# Inspect git diff --cached: ignore rules are not a secret scanner.
|
||||
|
||||
# Тулчейн студенческой реализации
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
.ty_cache/
|
||||
|
||||
# Локальные настройки агента
|
||||
.claude/settings.local.json
|
||||
|
||||
.verification/
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
## Что это за репозиторий
|
||||
|
||||
Skeleton лабораторной 5 курса «Мессенджер под нагрузкой» (МТУСИ, 7 независимых лаб) и решение в ветке `solution/bpi2303-kostylev`. Skeleton даёт задание (`README.md`), нормативный контракт (`contracts/`) и публичные black-box проверки (`tests/`). Реализация API, worker, relay, Dockerfile, compose-стенд, конфигурация балансировщика, S3 и брокера, миграции, хуки отказов и собственные тесты — студенческие; решение лабы 5 построено переносом решения лабы 4.
|
||||
|
||||
Лаба 5: приём вложения отделён от тяжёлой обработки. `POST /api/v1/chats/{chat_id}/attachments` проверяет файл как в лабе 4, кладёт оригинал в приватный префикс `staging/` bucket **RustFS** и одной транзакцией PostgreSQL фиксирует вложение `queued`, задание (`jobs`) и строку **transactional outbox**; только после этого отвечает `202` со снимком `queued`. Отдельный сервис `relay` публикует outbox в **RabbitMQ 4.1** (quorum queue, DLX, publisher confirms, `mandatory`, persistent), отдельный сервис `worker` (тот же образ, свой entrypoint) потребляет очередь через **FastStream** поверх aio-pika с ручным `ack` строго после `COMMIT` результата, захватывает задание арендой (`lease_token`), публикует оригинал в `originals/` и строит варианты Pillow. Источник истины состояний — PostgreSQL, брокер — транспорт и будильник. Остаётся всё из лаб 1–4: HAProxy перед ≥2 репликами, `X-Instance-Id`, `Idempotency-Key`, Basic → Bearer, хуки остановки реплики и рестарта стенда.
|
||||
|
||||
## Команды
|
||||
|
||||
```sh
|
||||
make check # offline: структура skeleton, JSON, локальные $ref, синтаксис Python, версия 1.5.0
|
||||
make validate PYTHON=.venv/bin/python # полная валидация OpenAPI 3.1 и jobs.schema.json (venv с requirements-dev.txt)
|
||||
make install # uv sync --group dev
|
||||
make lint # ruff check + ruff format --check + ty check; обязательно перед commit
|
||||
make student-test # собственные тесты (одноразовые PostgreSQL, Valkey, RustFS и RabbitMQ в Docker)
|
||||
|
||||
make secrets # локальные secrets/* (PostgreSQL, Valkey, S3 root/API/worker, RabbitMQ) и .env
|
||||
make up # docker compose build, затем up -d --wait (relay и worker пересоздаются на новом образе): хранилища и broker → migrate, s3-init → api ×2, relay, worker → lb
|
||||
make test # публичный smoke через LB (BASE_URL, по умолчанию http://localhost:8080)
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh # рестарт lb, api, relay, worker и postgres, valkey, s3, broker с volumes
|
||||
make test-failover ACTION_SCRIPT=scripts/stop-one.sh # остановка реплики TARGET_INSTANCE_ID под запросами
|
||||
make restore # вернуть остановленные реплики и дождаться их в ротации LB
|
||||
make worker-stop / worker-start # демонстрация «worker недоступен»
|
||||
make queues # очереди брокера: ready, unacked, consumers
|
||||
make level3 # сценарии уровня «3» suite (scripts/pipeline_suite.py) → evidence/level3.json
|
||||
make level4 # сценарии уровней «3» и «4» suite и инварианты → evidence/level4.json
|
||||
make failed / make replay ID=… / make dlq # реестр failed, явный replay, просмотр DLQ (python -m messenger.admin, rabbitmqadmin)
|
||||
make down # остановка без удаления данных; make reset-data — намеренное удаление volumes
|
||||
```
|
||||
|
||||
`tests/*.py` и `scripts/*.py` — только stdlib, синтаксис Python 3.9 (`make check` разбирает их системным `python3`). Проверки сами не поднимают стенд. Хуки `scripts/stop-one.sh` и `scripts/restart.sh` запускаются тестом без shell, поэтому исполняемые и с shebang. Данные не удаляются автоматически: каждый прогон smoke создаёт новых синтетических пользователей и вложения.
|
||||
|
||||
## Архитектура skeleton
|
||||
|
||||
- `lab.json` — единственный источник номера лабы (5). От него зависят `scripts/check_contract.py` (`info.version == 1.5.0`) и `tests/client.py` (ветки `LAB>=5`: upload отвечает `202 queued`, сообщение с вложением сразу, ожидание `ready` до 60 с от второго участника, ровно один вариант `thumbnail` 256×160 настоящим JPEG).
|
||||
- `tests/` байт в байт как в лабе 4; поведение переключает только `lab.json`. `tests/resilience.py` после хука рестарта запрашивает метаданные и оригинал один раз с таймаутом 2 с.
|
||||
- `contracts/jobs.schema.json` — формат сообщения брокера (7 обязательных полей, без bytes, URL, ключей S3 и filename); `contracts/attachment-states.md` — машина состояний и окна отказа.
|
||||
- `contracts/infrastructure.json` — роли `api`, `postgres`, `load_balancer`, `s3`, `broker` (persistent volume, at-least-once), `worker` (отдельный процесс). `compose.example.yaml` — только worksheet ролей.
|
||||
|
||||
## Ключевые правила контракта (lab5)
|
||||
|
||||
- Upload: те же лимиты и коды, что в лабе 4 (`413`, `415`, `400`, `404`), но успех — `202 Attachment` со снимком `status=queued`, `variants=[]`, `error_code=null`; снимок берётся из записанного объекта, а не перечитывается после публикации. `202` — только после записи оригинала в `staging/` и `COMMIT` вложения, задания и outbox.
|
||||
- Состояния: `queued → processing → ready | failed`; `processing → queued` при временной ошибке или истёкшей аренде; `failed → queued` только явным replay. `ready` не откатывается. `ready` выставляется, только когда записаны оригинал и все обещанные уровнем варианты.
|
||||
- `/content` для `queued`, `processing`, `failed` — `409 conflict` для любого `variant`, включая `original`; неизвестный `variant` — `400`; отсутствующий вариант `ready`-вложения — `404`; посторонний — `404`. Варианты: `thumbnail` JPEG вписан в 256×256 без увеличения, EXIF orientation применяется, alpha на белом, размеры вниз, минимум 1 px.
|
||||
- Сообщение: вложение `queued`/`processing` прикрепляется (`201`), `failed` — `409`, вложение другого чата или неизвестное — `404`.
|
||||
- Сообщение брокера — ровно поля `jobs.schema.json`; `job_id` не меняется при redelivery, `attempt` растёт только при управляемом повторе через outbox. Ключ эффекта — `(attachment_id, pipeline_version, variant)`.
|
||||
- Сохраняются правила lab4 (сырые байты, тип по содержимому, скачивание только через API без redirect), lab3 (`X-Instance-Id`, `Idempotency-Key`, LB не повторяет upload), lab2 (`Basic` только на входе, `Bearer` дальше, `WWW-Authenticate` по пути) и lab1 (формат ошибки, посторонний → `404`, keyset `(created_at, id)`, время RFC 3339 с `Z`).
|
||||
|
||||
## Правила работы с репозиторием
|
||||
|
||||
- Не менять и не ослаблять `contracts/`, `tests/`, `README.md`, `COURSE.md`, рубрику. Расхождение оформляется вопросом преподавателю.
|
||||
- Код — `src/messenger/`, миграции — `src/messenger/migrations/NNNN_*.sql`, конфигурация LB, нагрузки, S3 и брокера — `infra/`, хуки и обвязка стенда — `scripts/`, собственные тесты — `student-tests/`, обезличенные доказательства — `evidence/`.
|
||||
- Без комментариев в коде; отступы — пробелы (`[tool.ruff.format]`); Python 3.14 без `from __future__ import annotations` и `TYPE_CHECKING`.
|
||||
- Порты реплик API, S3, AMQP наружу не публикуются: только LB и UI брокера на `127.0.0.1`. API к брокеру не подключается. Клиенты брокера не объявляют очереди: топология — в `infra/rabbitmq/definitions.json`, права configure есть только у оператора.
|
||||
- `REPORT.md`: команды из чистого clone, архитектура, таблица «критерий → команда → наблюдение → файл», таблица отказов. PASS без команды не доказательство; для отказов — какой контейнер реально остановлен (`docker ps -a`).
|
||||
- Ветка `solution/bpi2303-kostylev`, коммиты на английском, перед каждым — `make lint`. Никогда не коммитить `.env`, `secrets/`, токены, ключи S3, пароли брокера, volumes, дампы.
|
||||
|
||||
## Уровни оценки
|
||||
|
||||
Решение заявлено на **«5»** с треком 2 «Доказанная идемпотентность pipeline»; таблица доказательств — в `REPORT.md`.
|
||||
|
||||
- **3** — `202 queued` после staging и `COMMIT` задания с outbox; отдельные `broker`, `relay`, `worker` в стенде; durable quorum queue, publisher confirm, ручной `ack` после `COMMIT`; состояния `queued/processing/ready/failed`, оригинал в `originals/` и thumbnail; ограниченный retry (`JOB_MAX_ATTEMPTS=5`) и `failed` с `error_code`; повтор job без второго набора вариантов; worker остановлен → upload → сообщение → рестарт API и broker → worker → `ready`; минимум lab4 сохранён.
|
||||
- **4** — crop и optimized WebP, лимиты worker по байтам, пикселям, времени и памяти, crash между `COMMIT` и publish, backoff с jitter и классификация ошибок, DLQ и replay, crash после записи объекта до `ack`, lease и fencing для зависшего `processing`, prefetch, очистка staging.
|
||||
- **5** — трек 2: `pipeline_version` 1 и 2, монотонная публикация, автоматический fault-injection (дубль, reorder, crash до и после side effect, устаревшая job) и проверка инвариантов одной командой.
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
FROM python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d AS builder
|
||||
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
|
||||
ENV UV_COMPILE_BYTECODE=1 \
|
||||
UV_LINK_MODE=copy \
|
||||
UV_PYTHON_DOWNLOADS=never \
|
||||
UV_PROJECT_ENVIRONMENT=/opt/venv
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY pyproject.toml uv.lock README.md ./
|
||||
RUN uv sync --locked --no-dev --no-install-project --no-editable
|
||||
|
||||
COPY src ./src
|
||||
RUN uv sync --locked --no-dev --no-editable
|
||||
|
||||
|
||||
FROM python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d AS runtime
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PATH="/opt/venv/bin:$PATH" \
|
||||
HOST=0.0.0.0 \
|
||||
PORT=8080 \
|
||||
LOG_LEVEL=INFO \
|
||||
WEB_CONCURRENCY=2 \
|
||||
REQUEST_TIMEOUT_SECONDS=8 \
|
||||
DRAIN_SECONDS=2 \
|
||||
SHUTDOWN_TIMEOUT_SECONDS=6
|
||||
|
||||
RUN groupadd --system --gid 10001 messenger \
|
||||
&& useradd --system --uid 10001 --gid messenger --no-create-home --shell /usr/sbin/nologin messenger
|
||||
|
||||
COPY --from=builder --chown=root:root /opt/venv /opt/venv
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --chown=root:root alembic.ini ./
|
||||
COPY --chown=root:root alembic ./alembic
|
||||
|
||||
USER 10001:10001
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD ["python", "-c", "import urllib.request,sys;sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/health/live',timeout=2).status==200 else 1)"]
|
||||
|
||||
CMD ["python", "-m", "gunicorn", \
|
||||
"--config", "python:messenger.gunicorn_conf", \
|
||||
"messenger.main:create_app()"]
|
||||
@@ -1,17 +1,66 @@
|
||||
PYTHON ?= python3
|
||||
BASE_URL ?= http://localhost:8080
|
||||
BASE_URL ?= http://$(shell docker compose port lb 8080 2>/dev/null || echo localhost:8080)
|
||||
CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover
|
||||
VENV ?= .venv
|
||||
UV ?= uv
|
||||
COMPOSE ?= docker compose
|
||||
RATE ?= 100
|
||||
FROM_REV ?=
|
||||
SHIFT ?= 0
|
||||
SCRIPTS_PY = scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py \
|
||||
scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py \
|
||||
scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
SCENARIO ?= failover-upload
|
||||
PSQL = $(COMPOSE) exec -T postgres psql -U messenger -d messenger -X -q
|
||||
TRACK2_OUTPUT ?= evidence/track2.json
|
||||
TRACK2_SCENARIOS = smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version
|
||||
PIPELINE_VERSION ?= 2
|
||||
PYTEST_ARGS ?=
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover \
|
||||
install lint format typecheck student-test \
|
||||
secrets up down reset-data migrate ps logs restore lb-check failover-evidence stack-evidence \
|
||||
persistence-evidence storage-evidence cache-evidence test-faults seed explain \
|
||||
limits detection failover-each rolling-update lab4-level4 \
|
||||
scenario s3-check attachments-evidence upload-faults upload-memory \
|
||||
images queues topology worker-stop worker-start broker-restart suite-preflight level3 \
|
||||
pipeline-evidence level4 replay failed dlq \
|
||||
faults-evidence retry-check reconcile reconcile-demo reconcile-cost load-evidence \
|
||||
clean-clone-evidence overload-leftovers
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
@echo "install/lint/typecheck/student-test: студенческий тулчейн"
|
||||
@echo "secrets/up/down/migrate/ps/logs: стенд Docker Compose; reset-data: намеренное удаление volumes"
|
||||
@echo "restore: вернуть остановленные реплики; lb-check: реплики на одном токене и 20 гонок одного ключа"
|
||||
@echo "lab4-level4 = limits, lb-check, detection, failover-each, rolling-update [FROM_REV=<коммит>]; RATE=$(RATE) rps"
|
||||
@echo "scenario SCENARIO=failover-upload|s3-outage → evidence/<сценарий>.json; s3-check; attachments-evidence"
|
||||
@echo "upload-faults: негативный suite, компенсация, уборка, обрыв и зависание загрузки против стенда"
|
||||
@echo "upload-memory: пик памяти реплик при 10/20/40 одновременных загрузках 1 и 10 MiB → evidence/upload-memory/"
|
||||
@echo "lab5: queues, topology, worker-stop/worker-start, broker-restart, images, suite-preflight, level3, level4"
|
||||
@echo "lab5 оператор: failed (реестр), replay ID=<attachment_id>, dlq (просмотр DLQ без извлечения)"
|
||||
@echo "retry-check: потерянный ответ на живой и на убитой реплике, повтор тем же ключом"
|
||||
@echo "lab4-level4 = limits, lb-check, detection, failover-each, rolling-update [FROM_REV=<коммит>]; RATE=$(RATE) rps"
|
||||
@echo "scenario SCENARIO=failover-upload|s3-outage → evidence/<сценарий>.json; s3-check; attachments-evidence"
|
||||
@echo "upload-faults: негативный suite, компенсация, уборка, обрыв и зависание загрузки против стенда"
|
||||
@echo "upload-memory ARGS='--out evidence/upload-memory/runN': пик памяти реплик при 10/20/40 загрузках 1 и 10 MiB"
|
||||
@echo "load-evidence: tests/load.py ×3 клиентом-контейнером в сети edge стенда → evidence/load.txt, evidence/load/"
|
||||
@echo "overload-leftovers: после upload-memory — намерения от 503, сверка и уборка после grace → evidence/overload-leftovers.txt"
|
||||
@echo "clean-clone-evidence: блок «Запуск из чистого clone» в свежем клоне рядом → evidence/clean-clone.txt"
|
||||
@echo "reconcile ARGS='--apply --deep': сверка PostgreSQL ↔ S3 (без ARGS — dry-run); трек 2:"
|
||||
@echo "reconcile-demo: внедрение ошибок, dry-run/apply/повтор, безопасность, нагрузка → evidence/reconcile/"
|
||||
@echo "reconcile-cost: стоимость обхода 1k/10k/30k/100k объектов × 3 прогона на чистом стенде → evidence/reconcile/cost/"
|
||||
@echo "BASE_URL=$(BASE_URL) (порт lb из docker compose); failover-evidence SHIFT=1 — сдвиг round robin на вторую реплику"
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
|
||||
validate: PYTHON := $(if $(wildcard $(VENV)/bin/python),$(VENV)/bin/python,$(PYTHON))
|
||||
validate:
|
||||
$(PYTHON) scripts/validate_openapi.py
|
||||
|
||||
@@ -28,3 +77,211 @@ test-persistence:
|
||||
test-failover:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook"; exit 2)
|
||||
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
install:
|
||||
$(UV) sync --group dev
|
||||
|
||||
lint:
|
||||
$(VENV)/bin/ruff check src student-tests $(SCRIPTS_PY)
|
||||
$(VENV)/bin/ruff format --check src student-tests $(SCRIPTS_PY)
|
||||
$(VENV)/bin/ty check src student-tests alembic
|
||||
|
||||
format:
|
||||
$(VENV)/bin/ruff check --fix src student-tests $(SCRIPTS_PY)
|
||||
$(VENV)/bin/ruff format src student-tests $(SCRIPTS_PY)
|
||||
|
||||
typecheck:
|
||||
$(VENV)/bin/ty check src student-tests alembic
|
||||
|
||||
student-test:
|
||||
$(VENV)/bin/pytest $(PYTEST_ARGS)
|
||||
|
||||
secrets:
|
||||
sh scripts/secrets.sh
|
||||
sh scripts/broker-secrets.sh
|
||||
|
||||
up: secrets
|
||||
$(COMPOSE) build
|
||||
$(COMPOSE) up -d --wait
|
||||
scripts/lb-wait.sh
|
||||
|
||||
down:
|
||||
$(COMPOSE) --profile bench --profile tools --profile reconcile down
|
||||
|
||||
reset-data:
|
||||
@echo "Удаляются volumes с учебными данными стенда"
|
||||
$(COMPOSE) --profile bench --profile tools --profile reconcile down -v --remove-orphans
|
||||
|
||||
migrate:
|
||||
$(COMPOSE) run --rm migrate
|
||||
|
||||
ps:
|
||||
$(COMPOSE) ps
|
||||
|
||||
logs:
|
||||
$(COMPOSE) logs --tail 200
|
||||
|
||||
restore:
|
||||
scripts/restore.sh
|
||||
|
||||
lb-check:
|
||||
$(PYTHON) scripts/probe.py check --rounds 20 --out evidence/lb-check.json
|
||||
|
||||
retry-check:
|
||||
$(PYTHON) scripts/probe.py retry --out evidence/retry.json
|
||||
|
||||
limits:
|
||||
$(PYTHON) scripts/limits.py --out evidence/limits.txt
|
||||
|
||||
detection:
|
||||
rm -rf evidence/detection
|
||||
for run in 1 2 3; do sh scripts/detection.sh evidence/detection/run$$run || exit 1; done
|
||||
|
||||
failover-each:
|
||||
RATE=$(RATE) sh scripts/failover-each.sh evidence/failover-each
|
||||
|
||||
rolling-update:
|
||||
ifneq ($(FROM_REV),)
|
||||
git archive "$(FROM_REV)" | docker build -q -t "mtusi-messenger:$(FROM_REV)" -
|
||||
API_IMAGE="mtusi-messenger:$(FROM_REV)" $(COMPOSE) up -d --no-deps --force-recreate --wait api
|
||||
scripts/lb-wait.sh
|
||||
endif
|
||||
$(COMPOSE) build -q api
|
||||
RATE=$(RATE) $(PYTHON) scripts/probe.py load --expect replace --duration 90 \
|
||||
--out evidence/rolling$(if $(FROM_REV),-from-$(FROM_REV)) \
|
||||
-- scripts/rolling-update.sh
|
||||
|
||||
lab4-level4: limits lb-check detection failover-each rolling-update
|
||||
|
||||
scenario:
|
||||
$(PYTHON) scripts/lab4_scenarios.py $(SCENARIO) --base-url "$(BASE_URL)" --restore --output evidence/$(SCENARIO).json
|
||||
scripts/lb-wait.sh
|
||||
|
||||
s3-check:
|
||||
sh scripts/s3-check.sh > evidence/s3-security.txt; status=$$?; cat evidence/s3-security.txt; exit $$status
|
||||
|
||||
attachments-evidence:
|
||||
sh scripts/evidence-attachments.sh
|
||||
|
||||
upload-faults:
|
||||
{ echo "date: $$(date -u +%FT%TZ) commit: $$(git rev-parse --short HEAD) BASE_URL=$(BASE_URL)"; \
|
||||
BASE_URL="$(BASE_URL)" $(VENV)/bin/pytest -m stack -v -s --no-header --tb=short \
|
||||
-p no:cacheprovider student-tests/stack/test_attachment_faults.py; } > evidence/upload-faults.txt; \
|
||||
status=$$?; cat evidence/upload-faults.txt; exit $$status
|
||||
|
||||
upload-memory:
|
||||
$(PYTHON) scripts/upload_memory.py --base-url "$(BASE_URL)" $(ARGS)
|
||||
|
||||
load-evidence:
|
||||
sh scripts/load-evidence.sh
|
||||
|
||||
overload-leftovers:
|
||||
sh scripts/overload-leftovers.sh
|
||||
|
||||
clean-clone-evidence:
|
||||
sh scripts/clean-clone.sh
|
||||
|
||||
reconcile:
|
||||
$(COMPOSE) run --rm --no-deps reconciler $(ARGS)
|
||||
|
||||
reconcile-demo:
|
||||
$(PYTHON) scripts/reconcile_track.py demo --base-url "$(BASE_URL)" $(ARGS)
|
||||
|
||||
reconcile-cost:
|
||||
$(PYTHON) scripts/reconcile_track.py cost $(ARGS)
|
||||
|
||||
failover-evidence:
|
||||
sh scripts/failover-evidence.sh "$(BASE_URL)" "$(SHIFT)"
|
||||
|
||||
stack-evidence:
|
||||
sh scripts/evidence-stack.sh
|
||||
|
||||
persistence-evidence:
|
||||
sh scripts/persistence-evidence.sh "$(BASE_URL)" > evidence/persistence.txt
|
||||
cat evidence/persistence.txt
|
||||
|
||||
storage-evidence:
|
||||
sh scripts/evidence-storage.sh
|
||||
|
||||
cache-evidence:
|
||||
sh scripts/evidence-cache.sh > evidence/cache.txt
|
||||
cat evidence/cache.txt
|
||||
|
||||
test-faults:
|
||||
BASE_URL="$(BASE_URL)" $(VENV)/bin/pytest -m stack -v -s student-tests/stack
|
||||
|
||||
faults-evidence:
|
||||
{ echo "date: $$(date -u +%FT%TZ) commit: $$(git rev-parse --short HEAD)"; echo "\$$ make test-faults"; \
|
||||
$(MAKE) --no-print-directory test-faults 2>&1; } | sed 's#$(CURDIR)#<repo>#g' > evidence/faults.txt
|
||||
cat evidence/faults.txt
|
||||
grep -qE '^=+ [0-9]+ passed in' evidence/faults.txt
|
||||
|
||||
seed:
|
||||
$(PSQL) -f - < scripts/sql/seed-history.sql
|
||||
|
||||
explain: seed
|
||||
{ echo "date: $$(date -u +%FT%TZ) commit: $$(git rev-parse --short HEAD)"; \
|
||||
echo "\$$ make explain # scripts/sql/explain-history.sql"; \
|
||||
$(PSQL) -f - < scripts/sql/explain-history.sql; } > evidence/explain-history.txt
|
||||
cat evidence/explain-history.txt
|
||||
|
||||
images:
|
||||
$(PYTHON) scripts/make_images.py
|
||||
|
||||
queues:
|
||||
sh scripts/broker.sh queues
|
||||
|
||||
topology:
|
||||
{ echo "date: $$(date -u +%FT%TZ) commit: $$(git rev-parse --short HEAD)"; \
|
||||
echo "$$ rabbitmqctl list_queues -p messenger name type durable policy messages"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_queues -p messenger name type durable policy messages; \
|
||||
echo "$$ rabbitmqctl list_consumers -p messenger"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_consumers -p messenger queue_name ack_required prefetch_count; \
|
||||
echo "$$ rabbitmqctl list_permissions -p messenger"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_permissions -p messenger; \
|
||||
echo "$$ rabbitmqctl list_users"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_users; \
|
||||
echo "$$ docker compose ps"; \
|
||||
$(COMPOSE) ps --format '{{.Service}}\t{{.Status}}\t{{.Ports}}'; } > evidence/topology.txt
|
||||
cat evidence/topology.txt
|
||||
|
||||
worker-stop:
|
||||
sh scripts/worker.sh stop
|
||||
|
||||
worker-start:
|
||||
sh scripts/worker.sh start
|
||||
|
||||
broker-restart:
|
||||
sh scripts/broker.sh restart
|
||||
|
||||
suite-preflight:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --preflight
|
||||
|
||||
level3:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --level 3 --output evidence/level3.json
|
||||
|
||||
level4:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --level 4 --output evidence/level4.json
|
||||
|
||||
failed:
|
||||
$(COMPOSE) run --rm --no-deps -T worker python -m messenger.admin failed
|
||||
|
||||
replay:
|
||||
@test -n "$(ID)" || (echo "Set ID=<attachment_id>"; exit 2)
|
||||
$(COMPOSE) run --rm --no-deps -T worker python -m messenger.admin replay --attachment-id "$(ID)"
|
||||
|
||||
dlq:
|
||||
sh scripts/broker.sh dlq
|
||||
|
||||
pipeline-evidence:
|
||||
$(PYTHON) scripts/pipeline_evidence.py --base-url "$(BASE_URL)" > evidence/pipeline-stand.txt; \
|
||||
status=$$?; cat evidence/pipeline-stand.txt; exit $$status
|
||||
|
||||
.PHONY: track2 reprocess
|
||||
|
||||
track2:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --level 5 --only "$(TRACK2_SCENARIOS)" --output "$(TRACK2_OUTPUT)"
|
||||
|
||||
reprocess:
|
||||
@test -n "$(ID)" || (echo "Set ID=<attachment_id>"; exit 2)
|
||||
$(COMPOSE) run --rm --no-deps -T worker python -m messenger.admin reprocess --attachment-id "$(ID)" --pipeline-version "$(PIPELINE_VERSION)"
|
||||
|
||||
@@ -1,37 +1,390 @@
|
||||
# Отчёт — лабораторная 5
|
||||
|
||||
- Автор, группа: TODO
|
||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
||||
- Commit/PR: TODO после публикации
|
||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
||||
- Автор, группа: Костылев Артём, БПИ2303
|
||||
- Целевая оценка: **5**; трек «5» — **трек 2 «Доказанная идемпотентность pipeline»**
|
||||
- Commit/PR: ветка `solution/bpi2303-kostylev`, PR в репозиторий преподавателя
|
||||
- Использованные источники, библиотеки и помощь ИИ: FastAPI, gunicorn + uvicorn-worker, dishka и
|
||||
dishka-faststream, pydantic, structlog, asyncpg, argon2-cffi, redis-py, aiobotocore/botocore, Pillow,
|
||||
FastStream 0.7 (`faststream[rabbit]`) поверх aio-pika, pytest, ruff, ty (версии — `evidence/environment.txt` и
|
||||
`uv.lock`); RabbitMQ docs (Reliability Guide, Consumer Acknowledgements and Publisher Confirms, Quorum Queues,
|
||||
Dead Lettering, Access Control, Definitions), документация FastStream 0.7 через context7 (ack policy, `Channel`,
|
||||
`RabbitQueue(declare=False)`, publisher confirms), Pillow (`ImageOps.exif_transpose`, режимы и альфа-канал),
|
||||
Docker Compose (secrets, `depends_on`, healthcheck). Заготовки брокера, compose-фрагмент, хуки и suite
|
||||
сценариев — из моей подготовки `.prep/lab5`. Решение перенесено из моей лабы 4 и выполнено с помощью Claude
|
||||
Code; код, стенд и отказы проверены прогонами, перечисленными ниже.
|
||||
|
||||
## Запуск из чистого clone
|
||||
|
||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
||||
Требуются Docker с Compose v2, `make`, системный Python 3.9+ (публичные проверки и сценарии) и `uv` (собственные
|
||||
тесты). Образы сторонних сервисов закреплены версией и digest, приложение собирается из исходников.
|
||||
|
||||
```sh
|
||||
git clone <repo> && cd mtusi2026lab5 && git checkout solution/bpi2303-kostylev
|
||||
|
||||
make secrets # secrets/*: PostgreSQL, Valkey, ключ курсора, root/API/worker-ключи S3, пароли и URL брокера,
|
||||
# rabbitmq_users.json с хешами паролей; .env из .env.example (существующее не перезаписывает)
|
||||
docker compose --env-file .env config --quiet
|
||||
make up # build, затем up -d --wait: postgres, valkey, s3, broker → migrate, s3-init → api ×2, relay, worker → lb
|
||||
make test # публичный smoke через балансировщик, http://localhost:8080
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
make restore # вернуть остановленную реплику и дождаться её в ротации LB
|
||||
make suite-preflight && make level3 # сценарии уровня «3» и инварианты → evidence/level3.json
|
||||
make level4 # сценарии уровней «3» и «4» и инварианты → evidence/level4.json (~8 мин)
|
||||
make failed # реестр failed-заданий (python -m messenger.admin failed)
|
||||
make replay ID=<attachment_id> # явный replay failed → queued с audit; ready → noop
|
||||
make dlq # просмотр DLQ без извлечения (rabbitmqadmin, ack_requeue_true)
|
||||
make pipeline-evidence # worker остановлен: 202, 409, задание в очереди, SIGTERM relay/worker
|
||||
make topology # очереди, consumer с prefetch, права, пользователи брокера → evidence/topology.txt
|
||||
make worker-stop / make worker-start / make broker-restart / make queues # ручная демонстрация защиты
|
||||
|
||||
make down # безопасная остановка: контейнеры удаляются, volumes pgdata, valkeydata, s3data, broker-data остаются
|
||||
make reset-data # НАМЕРЕННОЕ удаление учебных данных, включая байты вложений и очередь: docker compose down -v
|
||||
```
|
||||
|
||||
`make up` ждёт `healthy` всех долгоживущих сервисов и кода 0 одноразовых `migrate` (миграции под advisory lock)
|
||||
и `s3-init` (bucket, анонимный доступ `private`, политики и пользователи API и worker, lifecycle). Топологию
|
||||
брокера (vhost, exchanges, quorum-очереди, привязки, политики) и пользователей узел RabbitMQ импортирует из
|
||||
`/etc/rabbitmq/definitions.d` на каждой загрузке; повторный `make up`, `restart.sh` и `broker.sh restart` проходят
|
||||
без изменений состояния. Наружу публикуются только порты `lb` (`LB_HTTP_PORT` 8080, `LB_STATS_PORT` 8404) и UI
|
||||
брокера (`BROKER_MANAGEMENT_PORT` 15672), все на `127.0.0.1`. На машине, где выполнялась работа, параллельно
|
||||
работали стенды других лаб, поэтому в локальном `.env` стояли `LB_HTTP_PORT=18085`, `LB_STATS_PORT=25085`,
|
||||
`BROKER_MANAGEMENT_PORT=25672`, а проверки запускались с `BASE_URL=http://localhost:18085`. Доказательства уровня
|
||||
«3» впервые сняты на стенде, поднятом после `make reset-data` (пустые volumes), на коммите `fe26938`; доказательства
|
||||
уровней «3» и «4» в `evidence/` обновлены на коммите `0b85edf` (стенд пересобран `make up`, volumes сохранены).
|
||||
|
||||
Собственные проверки и тулчейн:
|
||||
|
||||
```sh
|
||||
make install # uv sync --group dev (Python 3.14 и зависимости из uv.lock)
|
||||
make lint # ruff check + ruff format --check (src, student-tests, Python-скрипты стенда) + ty check
|
||||
make student-test # собственные тесты; поднимают одноразовые PostgreSQL, Valkey, RustFS и RabbitMQ тех же образов
|
||||
make check # офлайн-проверка skeleton
|
||||
make validate PYTHON=<venv с requirements-dev.txt>/bin/python # полная валидация OpenAPI и jobs.schema.json
|
||||
make stack-evidence / make persistence-evidence / make failover-evidence # как в лабах 3–4
|
||||
```
|
||||
|
||||
**Версии и стенд:** Python 3.14.7 в образе `python:3.14-slim-trixie@sha256:51dafde8…`,
|
||||
`rabbitmq:4.1.8-management-alpine@sha256:54ef5ff5…` (RabbitMQ 4.1.8), `rustfs/rustfs:1.0.4@sha256:ed9210d6…`,
|
||||
`rustfs/rc:v0.1.36@sha256:ab024bfe…`, `haproxy:3.2.26-alpine@sha256:58938405…`,
|
||||
`postgres:17.11-alpine@sha256:266d3c25…`, `valkey/valkey:8.1.11-alpine@sha256:2602ace2…`; FastStream 0.7.8,
|
||||
aio-pika 10.2.1, aiormq 7.2.4, dishka-faststream 0.7.0, Pillow 13.0.0; Docker 28.3.2, Compose 2.38.2. Машина —
|
||||
Apple M4 Max, 16 CPU, 48 ГБ RAM, macOS 15.1; VM Docker Desktop — 16 CPU, 7.65 ГиБ (`evidence/environment.txt`).
|
||||
|
||||
## Архитектура и решения
|
||||
|
||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab4, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
||||
```
|
||||
┌─ api ×2 (gunicorn) ─ upload: проверка → PUT staging/<id> ──────────────▶ s3: RustFS
|
||||
клиент ─HTTP─▶ lb (HAProxy) ─────┤ одна транзакция: attachments(queued) + jobs + outbox + job_events ──▶ postgres
|
||||
127.0.0.1:8080 └─ 202 снимок queued; GET метаданных/контента читает PostgreSQL и S3 (источник истины)
|
||||
relay ── SELECT outbox … FOR UPDATE SKIP LOCKED ─▶ publish (confirm, mandatory, persistent) ─▶ broker: RabbitMQ
|
||||
└─ UPDATE published_at; возврат истёкших аренд; staging у ready и у failed после retention quorum attachments.process
|
||||
worker ◀── FastStream subscriber, prefetch = WORKER_CONCURRENCY, manual ack ───────────────────────┘ DLX → .dlq
|
||||
└─ claim (lease_token) → продление аренды → GET staging → процесс рендера: thumbnail, crop, optimized
|
||||
→ CopyObject originals/<id>, PUT variants/<id>/1/… → COMMIT (fencing, ON CONFLICT DO NOTHING,
|
||||
published_version < v) → ack
|
||||
admin (python -m messenger.admin, только PostgreSQL) ── failed: реестр; replay: failed → queued + outbox + audit
|
||||
сеть edge: lb, broker (UI на 127.0.0.1) ─── сеть backend (internal): все сервисы
|
||||
```
|
||||
|
||||
**Источник истины.** PostgreSQL — для всего, что знает система о вложении и задании: статус, ключи staging и
|
||||
оригинала, опубликованная версия, варианты, попытки, аренда, намерение публикации и журнал переходов. S3 — только
|
||||
для байтов (`staging/<id>`, `originals/<id>`, `variants/<id>/<версия>/<имя>-<sha256[:16]>.jpg`). Брокер —
|
||||
транспорт и будильник: сообщение несёт только идентификаторы по `jobs.schema.json`, worker берёт ключи хранилища
|
||||
из БД. Потерянное сообщение восстанавливается из PostgreSQL (outbox, возврат аренды), лишнее гасится захватом
|
||||
задания.
|
||||
|
||||
**Перенесено из лабы 4 без изменения поведения:** зоны `identity`, `messaging`, `attachments`, порты и адаптеры,
|
||||
UoW, шина событий с журналом аудита, ASGI-конвейер, Basic → Bearer, Argon2id, сессии в PostgreSQL с кэшем в
|
||||
Valkey, `X-Instance-Id`, `Idempotency-Key`, HAProxy с проверкой готовности, RustFS с приватным bucket, порядок
|
||||
проверок upload (лимит тела по маршруту, членство, `filename`, `Content-Type`, слоты, поток со счётчиком,
|
||||
проверка изображения по заголовку), компенсация и уборка намерений `pending` по grace period, хуки, сценарии и
|
||||
проверки уровня «4» лабы 4. **Изменено:** upload отвечает `202 queued`, оригинал пишется в `staging/`, вместо
|
||||
`ready` строка-намерение переходит в `queued` вместе с заданием и outbox; метаданные и `/content` показывают
|
||||
статусы и варианты; `messaging` отказывает `409` на `failed`-вложение; новые процессы `relay` и `worker`, сервис
|
||||
`broker`, миграция `0004`; `restart.sh` перезапускает ещё брокер, relay и worker; сценарии лабы 4 ждут `ready`.
|
||||
|
||||
**Процессы и границы зон.** Три долгоживущих процесса из одного образа: `api` (`messenger.main:create_app()`),
|
||||
`relay` (`python -m messenger.relay`), `worker` (`python -m messenger.worker`), и одноразовая CLI оператора
|
||||
`python -m messenger.admin`. `relay.py`, `worker.py` и `admin.py` — сборки процессов рядом с `main.py`; они знают
|
||||
только зону `attachments` и `shared`. Вся логика pipeline — в зоне `attachments`: домен заданий (`Job` и его
|
||||
сообщение, `Lease`, `Claim`, `RetryPolicy` с jitter, `FailureCode`, `Outcome`, `ReplayResult`, `FailedJob`, `Variant`,
|
||||
`fit`), обработчики `ProcessJob`, `PublishOutbox`, `RecoverExpiredLeases`, `CleanStaging`, `ReplayAttachment`, порты
|
||||
`JobPublisher`, `VariantRenderer`, `Faults`, `Jitter`, расширенные `ObjectStorage`, UoW и `AttachmentDirectory`,
|
||||
адаптеры FastStream (`infrastructure/rabbitmq.py`), Pillow и пула процессов рендера (`infrastructure/images.py`),
|
||||
PostgreSQL, `FAULT_POINT` и jitter, точки входа FastStream-подписчика, циклов relay и CLI оператора.
|
||||
Ядро `shared/` не импортирует ни веб-фреймворк, ни FastStream, ни aio-pika; dishka-контейнер worker и relay
|
||||
собирается из тех же `PlatformProvider` и адаптеров, что у API, через интеграцию `dishka-faststream`. Вопрос
|
||||
`messaging` «есть ли среди вложений `failed`» — порт `AttachmentStates` зоны `messaging`, адаптер которого над
|
||||
`AttachmentDirectory` собирает `main.py`. Правила проверяет `student-tests/api/test_bounded_contexts.py`.
|
||||
|
||||
**Схема** (`0004_jobs.sql`, expand): у `attachments` статусы `pending/queued/processing/ready/failed`,
|
||||
`staging_key`, `original_key`, `published_version`, `error_code` (CHECK: `invalid_image`, `processing_failed`,
|
||||
`retry_exhausted`); `object_key` лабы 4 перенесён в новые колонки и оставлен nullable до contract-миграции. Новые
|
||||
таблицы: `attachment_variants` с PK `(attachment_id, pipeline_version, name)` — ключ эффекта — и уникальным
|
||||
`object_key`; `jobs` (`UNIQUE (attachment_id, pipeline_version)`, `attempt`, `claims`, `lease_token`,
|
||||
`lease_until`, `next_attempt_at`, `last_error`); `outbox` (`payload jsonb`, `available_at`, `published_at`);
|
||||
`job_events` (журнал переходов). Частичные индексы: `outbox_pending_idx (available_at, id) WHERE published_at IS
|
||||
NULL` — выборка relay, `jobs_lease_idx (lease_until) WHERE status = 'processing'` — истёкшие аренды,
|
||||
`attachments_staged_idx (updated_at) WHERE staging_key IS NOT NULL` — уборка staging (`ready` и `failed` после
|
||||
retention). `0005_failed_registry.sql` (expand, только индекс): `jobs_failed_idx (updated_at DESC) WHERE status =
|
||||
'failed'` — реестр оператора `ORDER BY updated_at DESC LIMIT n`.
|
||||
|
||||
**Upload и что сохранено в момент `202`.** Лимиты и проверки лабы 4 не изменились. После проверки изображения:
|
||||
`INSERT attachments (pending, staging_key)` и `COMMIT` → `PutObject staging/<id>` → одна транзакция:
|
||||
`UPDATE attachments SET status='queued' WHERE status='pending'`, `INSERT jobs (pipeline_version=1, attempt=1)`,
|
||||
`INSERT outbox (payload по jobs.schema.json)`, `INSERT job_events ('enqueued')` → `202`. Ответ — снимок объекта
|
||||
из памяти (`queued`, `variants=[]`, `error_code=null`), не перечитанный после фиксации. К моменту `202` устойчиво
|
||||
сохранены полный проверенный оригинал в S3, метаданные, задание и намерение его публикации. API не строит
|
||||
вариантов и не подключается к брокеру: недоступный worker или брокер не влияет на upload.
|
||||
|
||||
**Outbox и relay.** Раз в `OUTBOX_POLL_SECONDS` (1 с) relay в транзакции берёт до 50 строк `WHERE published_at IS
|
||||
NULL AND available_at <= now() ORDER BY available_at, id FOR UPDATE SKIP LOCKED`, публикует каждую через
|
||||
`RabbitBroker.publish` (exchange `attachments` без объявления, routing key `attachment.process.v1`,
|
||||
`persist=True`, `mandatory=True`, `message_id = job_id`, `type = attachment.process.v1`, тело — ровно `payload`)
|
||||
и той же транзакцией ставит `published_at`. Канал открыт с `publisher_confirms=True` и `on_return_raises=True`:
|
||||
unroutable-сообщение, `basic.nack` или обрыв соединения — ошибка, строка остаётся неопубликованной и
|
||||
повторяется. Publisher confirm — подтверждение брокера, что сообщение записано в quorum queue; обработку он не
|
||||
подтверждает. Раз в `SWEEP_INTERVAL_SECONDS` (5 с) relay возвращает задания `processing` с истёкшей арендой
|
||||
(`queued`, `attempt + 1`, новая строка outbox, событие `lease_expired`; на пределе попыток — `failed`) и удаляет
|
||||
staging-объекты `ready`-вложений (у worker нет права `DeleteObject`).
|
||||
|
||||
**Worker: захват, фиксация, `ack`.** FastStream `RabbitBroker` (`logger=None`: журнал только через порт `Logger`),
|
||||
подписчик на `RabbitQueue("attachments.process", declare=False, quorum)` без привязки к exchange,
|
||||
`Channel(prefetch_count=WORKER_CONCURRENCY)`, `AckPolicy.MANUAL`, `graceful_timeout` 5 с. Сообщение не по схеме
|
||||
(pydantic-модель с `extra="forbid"`) — `reject(requeue=False)` в DLX. Дальше:
|
||||
|
||||
1. *Захват* — `UPDATE jobs SET status='processing', lease_token=<новый uuid>, lease_until=now()+JOB_TIMEOUT_SECONDS,
|
||||
claims=claims+1 WHERE job_id=$1 AND attachment_id=$2 AND pipeline_version=$3 AND ((status='queued' AND
|
||||
next_attempt_at наступил) OR (status='processing' AND lease_until < now()))`, вложение `queued → processing`,
|
||||
событие `claimed`. Нет строки — задание уже `done`/`failed`, держится живой арендой или повтор ещё не наступил:
|
||||
событие `duplicate_noop` и `ack`. `attempt` из сообщения информационный, захват идёт по `job_id`.
|
||||
2. *Побочные эффекты под арендой* — сначала продление аренды (`UPDATE jobs SET lease_until = now() + JOB_TIMEOUT_SECONDS
|
||||
WHERE job_id AND lease_token AND status='processing'`), затем задачей: чтение `staging/<id>`, рендер трёх вариантов
|
||||
в процессе рендера, `CopyObject staging → originals/<id>`, `PutObject variants/<id>/1/<имя>-<sha256[:16]>.<jpg|webp>`;
|
||||
пока задача идёт, аренда продлевается раз в `JOB_TIMEOUT_SECONDS / 3`. Продление не удалось (аренду забрали или
|
||||
задание уже вернули в очередь) — задача отменяется вместе с процессом рендера, событие `fenced`, `ack`. Ключ
|
||||
содержит хеш: повтор с другими байтами не перезапишет объект, на который уже ссылается БД.
|
||||
3. *Фиксация* — одна транзакция: `UPDATE jobs SET status='done' … WHERE status='processing' AND lease_token=$2`
|
||||
(0 строк — аренду перехватили: событие `fenced`, ничего не публикуется); `INSERT attachment_variants … ON
|
||||
CONFLICT DO NOTHING`; `UPDATE attachments SET status='ready', published_version=$v, original_key … WHERE
|
||||
published_version < $v` (0 строк — опубликована более новая версия: задание `superseded`); событие `done`.
|
||||
4. *`ack` — только после `COMMIT`.* Ошибка PostgreSQL до или во время фиксации — `nack(requeue=True)` через 1 с;
|
||||
если аренда уже взята, задание вернёт relay по её истечении.
|
||||
|
||||
**Повторы, jitter и классификация ошибок.** Временная ошибка — `Unavailable` от S3 или PostgreSQL, падение процесса
|
||||
рендера по внешней причине (`BrokenProcessPool`, например OOM killer), точка `transient_error` — возвращает задание
|
||||
и вложение в `queued` (не `failed` — smoke падает на первом `failed`) с тем же `job_id`, `attempt + 1` и новой
|
||||
строкой outbox. Задержка — equal jitter: `d = min(JOB_BACKOFF_CAP_SECONDS=60, JOB_BACKOFF_BASE_SECONDS · 2^(n−1))`,
|
||||
задержка `d/2 + U(0, d/2)` (`RetryPolicy.delay(attempt, spread)`, `spread` — порт `Jitter`, адаптер на
|
||||
`secrets.SystemRandom`); `next_attempt_at` и `available_at` считает PostgreSQL (`now() + make_interval`), задержка
|
||||
пишется в `job_events.detail.delay_seconds`. Full jitter не выбран: все пять попыток могли бы уложиться в доли
|
||||
секунды и короткий отказ S3 превратился бы в `retry_exhausted`; нижняя граница `d/2` держит суммарное окно 15–30 с
|
||||
при базе 2 с. После `JOB_MAX_ATTEMPTS` (5) попыток — `failed` с `retry_exhausted`. Постоянные ошибки — сразу
|
||||
`failed`, без повторов: не декодируется или больше `MAX_IMAGE_PIXELS` по заголовку — `invalid_image`; превышены
|
||||
время или память рендера, оригинал больше `MAX_UPLOAD_BYTES`, оригинала нет в хранилище, непредвиденная ошибка —
|
||||
`processing_failed`. В `error_code` — короткий код, в `jobs.last_error` — имя класса ошибки без текста. Все переходы
|
||||
— с fencing по `lease_token` и не трогают вложение в `ready`.
|
||||
|
||||
**Варианты.** Одно декодирование на задание (`render_variants`): проверка байтов (`MAX_UPLOAD_BYTES`) и пикселей по
|
||||
заголовку (`MAX_IMAGE_PIXELS`) до декодирования → для JPEG `draft()` до размера optimized (libjpeg сразу уменьшает в
|
||||
2/4/8 раз) → `ImageOps.exif_transpose(in_place=True)` до расчёта размеров → 16-битные режимы масштабируются в `L`,
|
||||
палитра с прозрачностью, `LA`, `RGBA` компонуются на белый фон, прочее — `convert("RGB")` → три
|
||||
`resize(LANCZOS, reducing_gap=3)`. Размеры — от размеров после ориентации по заголовку, целочисленно вниз:
|
||||
|
||||
| Вариант | Геометрия | Кодирование | Fixture 320×200 |
|
||||
| --- | --- | --- | --- |
|
||||
| `thumbnail` | вписан в 256×256, без увеличения, вниз, минимум 1 px | JPEG `quality=85`, `optimize=True` | 256×160 |
|
||||
| `crop` | `ImageOps.fit` в 128×128 по центру (`centering=(0.5, 0.5)`), увеличение разрешено | JPEG `quality=85`, `optimize=True` | 128×128 |
|
||||
| `optimized` | вписан в 1280×1280, без увеличения, вниз, минимум 1 px | WebP с потерями `quality=80`, `method=4` | 320×200 |
|
||||
|
||||
Метаданные (EXIF, ICC, XMP) в варианты не пишутся: кодеры Pillow 13 берут их только из явных параметров `save`,
|
||||
а мы их не передаём (`student-tests/unit/test_renderer.py` проверяет и `getexif()`, и `info`). Альфа в `optimized`
|
||||
тоже на белом — один источник для трёх вариантов; уменьшения каждого маленького файла WebP не обещает. Примеры:
|
||||
17×1000 → thumbnail 4×256, optimized 17×1000; 3000×2 → 256×1 и 1280×1; JPEG 4000×3000 → 256×192 и 1280×960; EXIF 6
|
||||
400×200 → 128×256 и 200×400. `ready` выставляет та же транзакция, что пишет строки трёх вариантов: частичного
|
||||
набора в API не бывает (`test_partial_variant_set_is_never_published`).
|
||||
|
||||
**Пределы worker.** Рендер — адаптер `ProcessVariantRenderer` порта `VariantRenderer`: `WORKER_CONCURRENCY` слотов,
|
||||
слот — `ProcessPoolExecutor(max_workers=1, max_tasks_per_child=RENDER_TASKS_PER_CHILD=100)` (forkserver), в
|
||||
процессе рендера `RLIMIT_AS = RENDER_MEMORY_MB` (448 MiB). Ожидание результата — `asyncio.wait_for(…,
|
||||
RENDER_TIMEOUT_SECONDS=30)`; таймаут → `kill_workers()` этого слота и новый процесс, `processing_failed`;
|
||||
`MemoryError` в процессе рендера → `processing_failed`; процесс убит снаружи → временная ошибка; отменённый рендер
|
||||
(потеря аренды, остановка) тоже убивает свой процесс. Слот на процесс, а не общий пул: убийство по таймауту не
|
||||
задевает соседнее задание. Замеры в образе: процесс рендера после импорта Pillow — 46 МБ адресного пространства,
|
||||
рендер трёх вариантов 8000×5000 — пик 258 МБ (RGB) и 398 МБ (RGBA); с пределом 300 МБ RGBA-рендер получает
|
||||
`MemoryError`. Поэтому `RENDER_MEMORY_MB=448` покрывает любое 8-битное изображение до 40 Мпикс, а предел контейнера
|
||||
`WORKER_MEMORY=1g ≥ 2 × 448 MiB + ~120 MiB` самого worker. Prefetch канала = `WORKER_CONCURRENCY` = число слотов:
|
||||
в полёте у процесса не больше двух заданий.
|
||||
|
||||
**Чтение.** `GET /attachments/{id}` отдаёт любой статус, кроме внутреннего `pending`, с вариантами опубликованной
|
||||
версии одним запросом (`jsonb_agg` по PK вариантов). `/content`: посторонний — `404`; не `ready` — `409 conflict`
|
||||
для любого `variant`, включая `original`; `original` — `original_key` с типом оригинала; `thumbnail` — вариант;
|
||||
`thumbnail`, `crop`, `optimized` — варианты опубликованной версии; варианта нет у опубликованной версии (вложение,
|
||||
ставшее `ready` в лабе 4) — `404`; иное значение `variant` — `400`. Сообщение со ссылкой на `failed` —
|
||||
`409`, на `queued`/`processing` — `201`; повтор по `Idempotency-Key` возвращает исходный ответ, даже если
|
||||
вложение потом стало `failed`.
|
||||
|
||||
**Готовность и SIGTERM.** `/health/ready` реплик API зависит только от PostgreSQL, как в лабе 4: брокер развязан
|
||||
outbox-ом, а при недоступном S3 upload и скачивание отвечают `503` от приложения, тексты работают. Relay и worker
|
||||
проверяются heartbeat-файлом, который обновляется, пока жив цикл событий и брокер отвечает на ping (от PostgreSQL и
|
||||
S3 не зависит — иначе worker не стартовал бы при временно недоступном S3). SIGTERM: worker отменяет consumer, ждёт
|
||||
задачи до 5 с, закрывает канал (неподтверждённые сообщения возвращаются в очередь); relay завершает циклы и
|
||||
закрывает соединение; оба выходят с кодом 0 за 0,5 с (`evidence/pipeline-stand.txt`).
|
||||
|
||||
**Окна отказа** (`contracts/attachment-states.md`). Точки падения задаёт `FAULT_POINT` только в
|
||||
`infra/compose.faults.yaml` (там же `restart: "no"`, аренда 5 с, база backoff 1 с); падение — `os._exit(137)` после
|
||||
сброса журналов, без какой-либо дальнейшей работы; порт `Faults` вызывается в обработчиках зоны:
|
||||
|
||||
| Окно | Точка `FAULT_POINT` (процесс) | Что лежит после сбоя | Кто восстанавливает | Сценарий |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 1: после staging, до записи задания | — (API) | невидимая строка `pending` и объект `staging/`, `202` не отдан | компенсация сразу; уборка намерений лабы 4 после grace | `make upload-faults` (лаба 4) |
|
||||
| 2: после `COMMIT`, до publish | `after_commit_before_publish` (relay: строка взята `FOR UPDATE`, publish не отправлен) | строка outbox без `published_at`, очередь пуста, вложение `queued` | relay после рестарта, тот же `job_id` | `crash_commit_publish` |
|
||||
| 3: после publish, до confirm/`published_at` | `after_publish_before_confirm` (relay: confirm получен, `published_at` не записан) | сообщение в очереди, строка не помечена | relay публикует повторно, вторая копия — `duplicate_noop` | `crash_publish_confirm` |
|
||||
| — после захвата, до побочных эффектов | `after_claim_before_side_effect` (worker) | `processing`, живая аренда, S3 пуст | redelivery видит живую аренду → `ack`; relay возвращает задание по истечении аренды | трек 2 |
|
||||
| 4: после записи S3, до `COMMIT` результата | `after_s3_write_before_commit` (worker) | объекты трёх вариантов и оригинала, строк вариантов нет | relay возвращает аренду, попытка 2 пишет те же ключи и фиксирует | `crash_after_s3_before_commit` |
|
||||
| 5: после `COMMIT`, до `ack` | `after_commit_before_ack` (worker) | `ready`, сообщение не подтверждено | redelivery видит `done` → `duplicate_noop` и `ack` | `crash_after_commit_before_ack` |
|
||||
| зависший держатель | `stall_after_claim` (worker: один раз спит `FAULT_STALL_SECONDS`=15 с без продления) | аренда истекает | relay возвращает задание, вторая попытка → `ready`; проснувшийся держатель не продлевает аренду → `fenced` | `lease_expiry_fencing` |
|
||||
|
||||
Окно 3 воспроизводится состоянием, а не моментом: FastStream ждёт confirm внутри `publish`, поэтому процесс падает
|
||||
уже после confirm, но до записи `published_at`; для системы это то же — брокер знает о сообщении, PostgreSQL нет.
|
||||
|
||||
At-least-once доставки + идемпотентный эффект по ключу `(attachment_id, pipeline_version, variant)` + fencing по
|
||||
`lease_token` = один опубликованный результат. Это не exactly-once: окна 3 и 5 дают повторные доставки, их гасит
|
||||
эффект, а не брокер.
|
||||
|
||||
**Топология брокера** (`infra/rabbitmq/definitions.json`, импорт на каждой загрузке): vhost `messenger`
|
||||
(`default_queue_type: quorum`); exchange `attachments` (direct) → `attachments.process` (quorum, durable);
|
||||
`attachments.dlx` (fanout) → `attachments.process.dlq` (quorum); политика `attachments-process`:
|
||||
`dead-letter-exchange=attachments.dlx`, `dead-letter-strategy=at-least-once`, `overflow=reject-publish`,
|
||||
`delivery-limit=10`; DLQ — `max-length=100000`. DLX и delivery-limit заданы политикой, поэтому клиенты делают
|
||||
только пассивный declare и не получают `PRECONDITION_FAILED`. Права (`evidence/topology.txt`): `messenger-api`
|
||||
(relay) — только запись в `attachments`, `messenger-worker` — только чтение `attachments.process`,
|
||||
`messenger-ops` — оператор; `guest` нет. В `rabbitmq.conf`: `consumer_timeout` 300 с (больше аренды 60 с),
|
||||
`vm_memory_high_watermark` 256 MiB, запрет transient-очередей и global QoS.
|
||||
|
||||
**Роли и сервисы** (`compose.yaml`; сети `edge` и `backend` с `internal: true`):
|
||||
|
||||
| Роль | Сервис | Версия / digest | Health / readiness | Volume | Сеть / порт | Credentials |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| load_balancer | `lb` | `haproxy:3.2.26-alpine@sha256:58938405…`, uid 99, `read_only` | `/healthz` :8404; реплики — `GET /health/ready` | нет | `edge` + `backend`; `127.0.0.1:${LB_HTTP_PORT:-8080}`, `127.0.0.1:${LB_STATS_PORT:-8404}` | нет |
|
||||
| api ×`API_REPLICAS` | `api` | сборка из `Dockerfile`, uid 10001, `read_only` | `GET /health/ready` (PostgreSQL) | нет | `backend`, без портов | `database_url`, `cache_url`, `cursor_secret`, ключ API S3 через `*_FILE`; брокера нет |
|
||||
| broker | `broker` | `rabbitmq:4.1.8-management-alpine@sha256:54ef5ff5…`, uid 100, `hostname: broker`, `read_only`, `cap_drop: ALL` | `rabbitmq-diagnostics -q check_port_connectivity` | `broker-data:/var/lib/rabbitmq` | `backend` + `edge`; AMQP 5672 внутри; UI `127.0.0.1:${BROKER_MANAGEMENT_PORT:-15672}` | definitions с хешами паролей — secret `rabbitmq_users`; пароль оператора — `rabbitmq_ops_password` |
|
||||
| outbox relay | `relay` | образ приложения, `python -m messenger.relay`, `init`, `read_only` | heartbeat `/tmp/heartbeat` моложе 30 с | нет | `backend`, без портов | `database_url`, `broker_url` ← `broker_url_api`, ключ API S3 |
|
||||
| worker | `worker` | образ приложения, `python -m messenger.worker`, `init`, `read_only` | heartbeat `/tmp/heartbeat` моложе 30 с | нет | `backend`, без портов | `database_url`, `broker_url` ← `broker_url_worker`, ключ worker S3 |
|
||||
| postgres | `postgres` | `postgres:17.11-alpine@sha256:266d3c25…`, uid 70 | `pg_isready` | `pgdata` | `backend` | `postgres_password` через `POSTGRES_PASSWORD_FILE` |
|
||||
| s3 | `s3` | `rustfs/rustfs:1.0.4@sha256:ed9210d6…`, uid 10001, консоль выключена | `curl /health/ready` | `s3data` | `backend`, :9000 без публикации | root-ключи через `RUSTFS_*_FILE` |
|
||||
| bootstrap S3 | `s3-init` | `rustfs/rc:v0.1.36@sha256:ab024bfe…` | код выхода 0 | нет | `backend` | root-ключи, ключи API и worker (создаёт пользователей) |
|
||||
| bootstrap схемы | `migrate` | образ приложения, `restart: "no"` | код выхода 0 | нет | `backend` | `database_url` |
|
||||
| сессии (кэш) | `valkey` | `valkey/valkey:8.1.11-alpine@sha256:2602ace2…`, uid 999 | `valkey-cli ping` | `valkeydata` (AOF) | `backend` | `valkey.conf` |
|
||||
| CLI S3 и нагрузка | `s3-cli` (профиль `tools`), `k6` (профиль `bench`) | как в лабе 4 | нет | нет | `backend` / `edge` | как в лабе 4 |
|
||||
|
||||
Bootstrap: схема — `migrate` (advisory lock, повтор без изменений); bucket, политики `messenger-api`
|
||||
(`infra/s3/api-policy.json`) и `messenger-worker` (`infra/s3/worker-policy.json`: чтение `staging/`, `originals/`,
|
||||
`variants/`, запись `originals/` и `variants/`), пользователи и lifecycle — `s3-init` (`--ignore-existing`, повтор
|
||||
без изменений, самопроверка политик); топология и пользователи брокера — definitions на загрузке узла
|
||||
(идемпотентный импорт; ротация пароля — удалить `secrets/rabbitmq_<роль>_password` и `broker_url_<роль>`,
|
||||
`make secrets`, `docker compose up -d broker relay worker`). Лимиты: broker 1/512m, relay 0.5/192m, worker
|
||||
2/1g (два процесса рендера по 448 MiB и сам worker), остальное как в лабе 4; `make limits` проверяет политику секретов, volumes, сетей и портов
|
||||
(`evidence/limits.txt`).
|
||||
|
||||
**Соответствие `.env.example` реальной конфигурации:**
|
||||
|
||||
| `.env.example` | В решении | Комментарий |
|
||||
| --- | --- | --- |
|
||||
| `APP_*`, `SESSION_*`, `DATABASE_URL_FILE`, `CACHE_URL_FILE`, `API_REPLICAS`, `IDEMPOTENCY_TTL_SECONDS`, `S3_*`, `MAX_UPLOAD_BYTES`, `MAX_IMAGE_PIXELS` | как в лабе 4 | |
|
||||
| `BROKER_URL_FILE=/run/secrets/broker_url` | тот же у `relay` и `worker` | разные secrets: `broker_url_api` и `broker_url_worker`; у API нет |
|
||||
| `WORKER_CONCURRENCY=2` | тот же | prefetch канала consumer и параллельные рендеры одного worker |
|
||||
| `JOB_MAX_ATTEMPTS=5` | тот же | предел попыток; последняя неудача — `retry_exhausted` |
|
||||
| `JOB_TIMEOUT_SECONDS=60` | тот же | аренда захваченного задания; меньше `consumer_timeout` 300 с |
|
||||
| `STAGING_RETENTION_SECONDS=86400` | тот же (настройка relay) | staging `ready`-вложения relay удаляет сразу после публикации, `failed` — через `STAGING_RETENTION_SECONDS` после перехода в `failed` (до этого возможен replay) |
|
||||
| — | `BROKER_MANAGEMENT_PORT`, `JOB_BACKOFF_BASE_SECONDS`, `OUTBOX_POLL_SECONDS`, `SWEEP_INTERVAL_SECONDS`, `WORKER_CPUS`, `WORKER_MEMORY`, `PIPELINE_DB_POOL_MAX_SIZE` | UI брокера; база backoff 2 с; опрос outbox 1 с; возврат аренд и уборка staging 5 с; лимиты worker; пул PostgreSQL relay и worker |
|
||||
| — | `RENDER_TIMEOUT_SECONDS=30`, `RENDER_MEMORY_MB=448`, `RENDER_TASKS_PER_CHILD=100`, `WORKER_MEMORY=1g` | время рендера (процесс убивается), адресное пространство процесса рендера, задач на процесс; `WORKER_MEMORY ≥ WORKER_CONCURRENCY · RENDER_MEMORY_MB` + ~120 MiB |
|
||||
| — | `FAULT_POINT`, `FAULT_STALL_SECONDS`, `FAULT_RENDER_TIMEOUT_SECONDS`, `FAULT_RENDER_MEMORY_MB`, `FAULT_STAGING_RETENTION_SECONDS` | только в `infra/compose.faults.yaml` (короткие аренда и backoff, `restart: "no"`), никогда в основном стенде; suite переводит relay и worker в этот режим и возвращает обратно |
|
||||
| — | прочие `LB_*`, `API_*`, `PG_*`, `UPLOAD_*`, `S3_*_TIMEOUT_SECONDS`, `MALLOC_MMAP_THRESHOLD_` | как в лабе 4 |
|
||||
|
||||
## Доказательства критериев
|
||||
|
||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
||||
| --- | --- | --- | --- |
|
||||
| Публичный smoke | make test | TODO | TODO |
|
||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
||||
|
||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
||||
| Публичный smoke | `make test BASE_URL=http://localhost:18085` | `PASS: lab5 public API scenario` (upload → `202 queued`, сразу сообщение `text=""` с вложением → `201`, `ready` от bob, оригинал побайтно `image/png`, eve `404`, один вариант `thumbnail` 256×160, настоящий JPEG той же длины и SHA-256, весь минимум lab2–lab4) | `evidence/smoke.txt` |
|
||||
| `make check` / `make validate` / `make lint` | `make check`; `make validate` в venv с `requirements-dev.txt`; `make lint` | `PASS: offline skeleton structure…`; `PASS: full OpenAPI 3.1 and JSON Schema validation`; ruff, формат, ty — `All checks passed!` | `evidence/contract-checks.txt` |
|
||||
| Собственные тесты | `make student-test` | `417 passed, 1 skipped` (предел `RLIMIT_AS` — только Linux; 15 проверок стенда под маркером `stack` — отдельно): pipeline против PostgreSQL, восстановление после внедрённых падений, продление аренды, replay и retention, пул процессов рендера, три варианта, jitter, CLI оператора, адаптеры против RabbitMQ и RustFS, контракт сообщения, архитектура | `evidence/student-tests.txt` |
|
||||
| **3.1** `202` только после устойчивого staging и сохранения задания; остановка API после ответа не теряет работу | `make level3` (`worker_down_broker_restart`), `make pipeline-evidence`; тесты `test_attachments.py`, `test_upload_consistency.py`, `test_pipeline.py` | ответ — снимок `queued`, в БД ключ `staging/<id>`, задание и строка outbox; отказ фиксации после записи staging → `503`, нет ни строки, ни задания, ни объекта; после `202` перезапущены обе реплики API и relay — задание одно в очереди и доходит до `ready` | `evidence/level3.json`, `evidence/pipeline-stand.txt`, `evidence/student-tests.txt` |
|
||||
| **3.2** Отдельные broker и worker в общем стенде; durable, at-least-once, подтверждение после эффекта | `make topology`; `make pipeline-evidence`; `test_rabbitmq.py` | `attachments.process` и `.dlq` — `quorum`, `durable`, политики применены; один consumer `ack_required=true`, `prefetch_count=2`; сообщение в очереди: `delivery_mode: 2`, `message_id` = `job_id`, тело — ровно 7 полей `jobs.schema.json`; `ack` только после `COMMIT` (ошибка обработки → `nack` → повторная доставка до успеха); сообщение не по схеме → DLQ; учётка worker не может публиковать | `evidence/topology.txt`, `evidence/pipeline-stand.txt`, `evidence/student-tests.txt` |
|
||||
| **3.2** Недоступность worker не заставляет API делать resize синхронно | `make pipeline-evidence`, `worker_down_broker_restart` | worker остановлен: upload `202 queued`, `/content` (`original` и `thumbnail`) → `409`, сообщение с вложением `201`, текст и история работают, вложение остаётся `queued`, задание лежит в очереди (`messages_ready=1`) | `evidence/pipeline-stand.txt`, `evidence/level3.json` |
|
||||
| **3.3** Состояния `queued/processing/ready/failed`; оригинал неизменен, thumbnail по контракту | `make test`, `smoke_pipeline`, `test_pipeline.py`, `test_renderer.py` | переходы видны в API и `job_events` (`enqueued → claimed → done`); оригинал из `originals/<id>` побайтно равен загруженному; thumbnail 256×160 JPEG, длина и SHA-256 равны метаданным; инвариант `bytes_match_metadata` — PASS | `evidence/smoke.txt`, `evidence/level3.json`, `evidence/student-tests.txt` |
|
||||
| **3.4** Ограниченный retry, финальное `failed` с безопасным `error_code` | `retry_exhausted`, `s3_outage_recovers` (`make level3`); `test_pipeline.py` | точка `transient_error`: задание `failed`, `attempt = 5 = JOB_MAX_ATTEMPTS`, `error_code = retry_exhausted`, `/content` и сообщение со ссылкой → `409`; S3 остановлен во время обработки → вложение `queued` с `attempt = 2`, после возврата S3 — `ready`; нечитаемый оригинал → `invalid_image` с `attempt = 1`; следующая попытка отложена на базу backoff; инвариант `bounded_attempts` — PASS | `evidence/level3.json`, `evidence/student-tests.txt` |
|
||||
| **3.4** Повтор одной job не создаёт второго набора вариантов | `duplicate_after_ready`; `test_pipeline.py` | копия сообщения после `ready` → `duplicate_noop`, метаданные и строки вариантов до и после равны; две копии одновременно → один `done` и один `duplicate_noop`, одна строка варианта, `claims = 1`; опоздавший держатель аренды → `fenced`, вариантов не добавил; инвариант `single_effect` — PASS | `evidence/level3.json`, `evidence/student-tests.txt` |
|
||||
| **3.5** Демонстрация: worker остановлен → upload `202` → сообщение → рестарт API → worker → `ready`; задание переживает рестарт broker с volume | `make level3` (`worker_down_broker_restart`) | хронология с ID без токенов: worker остановлен 22:20:24.58; upload `202 queued` (`01a18499-a689…`); `/content` `409`; сообщение `201` (`01a18499-a698…`); в очереди `[1, 0]`; обе реплики API и relay перезапущены; broker перезапущен с volume — в очереди снова `[1, 0]`; worker запущен 22:20:49.24, `ready` с `thumbnail` 22:20:49.42 | `evidence/level3.json` |
|
||||
| **3.5** Минимум lab4: persistence | `make persistence-evidence` | `PASS: persistence …`; `StartedAt` у `lb`, обеих `api`, `relay`, `worker`, `postgres`, `valkey`, `s3`, `broker` новее, контейнеры те же, hostname брокера `broker` | `evidence/persistence.txt` |
|
||||
| **3.5** Минимум lab4: failover | `make failover-evidence` | `PASS: failover …`: 2 реплики до отказа, 134 записи, 0 ошибок, первая запись через 2,85 с; цель `db66b246dcf8` в `exited`, в её журнале сигнал, окно readiness `503`, выход; `make restore` вернул реплику | `evidence/failover.txt` |
|
||||
| Минимум lab4: download через другую реплику, недоступный S3, приватность, негативный suite, политика | `make scenario SCENARIO=failover-upload`, `SCENARIO=s3-outage`, `make s3-check`, `make upload-faults`, `make limits` | upload принят `db66b246dcf8`, после `ready` и её остановки — скачивание через `6f688eb249b1` за 2,87 с, SHA-256 равен; S3 остановлен: upload и `/content` `503` за 4,5–4,7 с, метаданные, текст и readiness работают; `RESULT: PASS`; 5 проверок стенда, 0 × `5xx`; политика портов, секретов и сетей — PASS | `evidence/failover-upload.json`, `evidence/s3-outage.json`, `evidence/s3-security.txt`, `evidence/upload-faults.txt`, `evidence/limits.txt` |
|
||||
| Инварианты suite уровня «3» | `make suite-preflight && make level3` | 6/6 сценариев PASS; `terminal`, `single_effect`, `no_ready_rollback`, `monotonic_publication`, `bytes_match_metadata`, `bounded_attempts`, `no_orphans` (очереди пусты, outbox опубликован, staging `ready` убран, лишних писем в DLQ нет), `no_lost_202` — PASS | `evidence/level3.json` |
|
||||
| **4.1** Crop 128×128 и optimized WebP по контракту, параметры качества и удаления метаданных | `make level4` (`image_matrix`, `smoke_pipeline`), `test_renderer.py`, `test_attachments.py` | 17 изображений матрицы (RGB, RGBA, палитра с tRNS, серые 8/16 бит, CMYK, EXIF 6 и 3, 1×1, 3000×2, 4000×3000, ровно 10 MiB) → `ready` с `crop`, `optimized`, `thumbnail`; у каждого варианта реальные размеры из SOF/VP8 равны метаданным и manifest, длина и SHA-256 равны отдаваемым байтам; fixture: 256×160, 128×128, 320×200; в вариантах нет EXIF, ICC, XMP; частичный набор не публикуется | `evidence/level4.json`, `evidence/student-tests.txt` |
|
||||
| **4.1** Пределы по байтам, пикселям, времени и памяти worker | `make level4` (`image_matrix`, `worker_limits`), `test_render_pool.py`, `test_renderer.py` | вход: 10 485 761 B, 8001×5000 и 10000×5000 → `413`, битые и не-изображения → `415`; worker: PNG 8000×5000 при `RENDER_TIMEOUT_SECONDS=0,5` и при `RENDER_MEMORY_MB=200` → `failed processing_failed` с `attempt 1`, контейнер worker `running`; со штатными пределами тот же файл → `ready`, пик `memory.peak` 379 MiB при `memory.max` 1024 MiB; в тестах таймаут убивает процесс и освобождает слот, падение процесса рендера — временная ошибка, `MemoryError` — постоянная | `evidence/level4.json`, `evidence/student-tests.txt` |
|
||||
| **4.2** Transactional outbox; crash между `COMMIT` и publish, восстановление без нового задания | `make level4` (`crash_commit_publish`, `crash_publish_confirm`), `test_recovery.py` | relay с `after_commit_before_publish` → exit 137, строка outbox `published=false`, очередь `[0, 0]`, вложение `queued`; relay перезапущен без точки → `ready` с тем же `job_id`, outbox опубликован; `after_publish_before_confirm` → exit 137, строка не помечена, после рестарта повторная публикация, вторая копия — `duplicate_noop` | `evidence/level4.json`, `evidence/student-tests.txt` |
|
||||
| **4.3** Backoff с jitter, постоянные и временные ошибки | `make level4` (`retry_backoff_jitter`, `s3_outage_recovers`, `poison_image`, `retry_exhausted`), `test_pipeline_domain.py`, `test_pipeline.py` | задержки попыток 2–5 при базе 1 с: 0,69; 1,74; 2,83; 7,55 с — доли верхней границы 0,69; 0,87; 0,71; 0,94 в `[0,5; 1]` (`make replay` в `evidence/operator.txt`: 0,55; 1,71; 2,20; 4,25 с); S3 остановлен → `queued`, затем `ready`; таймаут/память рендера и пропавший оригинал → `processing_failed`, нечитаемое изображение → `invalid_image`, оба с `attempt 1`; 200 случайных задержек лежат в `[d/2, d)` | `evidence/level4.json`, `evidence/student-tests.txt` |
|
||||
| **4.3** DLQ, реестр `failed` и безопасный явный replay; повтор не исполняет дубль успешной job | `make level4` (`replay_failed`, `malformed_message_dead_lettered`, `failed_retention`); `make failed`, `make replay ID=…`, `make dlq`; `test_recovery.py` | `retry_exhausted` → `replay` → `{"result": "replayed"}` → `ready` (журнал `… failed, replayed, claimed, done`); повторный replay `ready` → `{"result": "noop"}`, снимок вариантов равен, событие `replay_noop`; staging `failed` хранится до retention, после него replay → `expired`; сообщение не по схеме → DLQ, видно `make dlq` без извлечения | `evidence/level4.json`, `evidence/operator.txt` |
|
||||
| **4.4** Остановка worker после записи объекта, но до `ack`; повтор завершает тот же результат | `make level4` (`crash_after_s3_before_commit`, `crash_after_commit_before_ack`), `test_recovery.py` | `after_s3_write_before_commit` → exit 137, вложение `processing`, строк вариантов 0; после запуска worker — `ready` на попытке 2, те же ключи объектов; `after_commit_before_ack` → exit 137, вложение уже `ready`; redelivery → `duplicate_noop`, строки вариантов до и после равны | `evidence/level4.json`, `evidence/student-tests.txt` |
|
||||
| **4.4** Timeout/lease для зависшего `processing`, ограниченная конкуренция/prefetch, очистка staging после фиксации | `make level4` (`lease_expiry_fencing`), `make topology`, инвариант `no_orphans`; `test_recovery.py` | `stall_after_claim` (15 с при аренде 5 с): журнал `claimed(1), lease_expired(2), claimed(2), done(2), fenced(1)`, снимок результата до и после пробуждения равен; долгий рендер (2,5 с при аренде 1 с) продлевает аренду и не возвращается relay; consumer `prefetch_count=2` = `WORKER_CONCURRENCY` = слоты рендера; staging `ready` убран (`staging_left` пуст), `failed` — по retention | `evidence/level4.json`, `evidence/topology.txt` |
|
||||
| Инварианты suite уровня «4» | `make suite-preflight && make level4` | 17/17 сценариев PASS за 6 мин 14 с; `terminal`, `single_effect`, `no_ready_rollback`, `monotonic_publication`, `bytes_match_metadata` (28 `ready`), `bounded_attempts`, `no_orphans` (очередь `[0, 0]`, в DLQ ровно ожидаемое письмо), `no_lost_202` (33 из 33) — PASS | `evidence/level4.json` |
|
||||
| Сценарий защиты п. 4 | `make level4` или по одному: `pipeline_suite.py --only crash_after_commit_before_ack,crash_commit_publish,replay_failed` | crash после side effect до `ack`, разрыв `COMMIT`/publish и replay `failed` — строки 4.2–4.4 | `evidence/level4.json` |
|
||||
| Трек 2 | — | заполняется изменением трека 2: versioned pipeline, fault-injection suite одной командой, инварианты | — |
|
||||
|
||||
## Эксперименты и отказы
|
||||
|
||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
||||
Стенд: 2 реплики `api` (1 CPU, 512 MiB), worker 2 CPU / 1 GiB, relay 0.5 CPU / 192 MiB, RabbitMQ 1 CPU /
|
||||
512 MiB, RustFS 1 CPU / 512 MiB, PostgreSQL 2 CPU / 1 GiB; Docker Desktop VM 16 CPU, 7.65 ГиБ, параллельно
|
||||
работали стенды других лаб. Данные — синтетические пользователи и fixture `sample.png` (111 817 B). Сценарии
|
||||
suite идут с `infra/compose.faults.yaml` у relay и worker (аренда 5 с, база backoff 1 с, опрос outbox 0,5 с).
|
||||
|
||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
||||
| --- | --- | --- | --- |
|
||||
| TODO | TODO | TODO | TODO |
|
||||
| Worker остановлен, upload и сообщение | `202 queued`, `409` на `/content`, сообщения работают, задание в очереди | так и есть; `messages_ready=1` | `ready` через 0,2 с после запуска worker; потерь нет |
|
||||
| Рестарт обеих реплик API и relay после `202` | задание не теряется и не дублируется | в очереди одна копия до и после | потерь нет |
|
||||
| `scripts/broker.sh restart` при остановленном worker | durable сообщение переживает рестарт | `[1, 0]` до и после, имя узла `rabbit@broker` неизменно | брокер healthy за ~9 с; потерь нет |
|
||||
| Повторная доставка выполненной job (`rabbitmqadmin publish` той же копии) | no-op с `ack`, результат не меняется | `duplicate_noop`, снимок вариантов равен | — |
|
||||
| S3 остановлен во время обработки | временная ошибка, `queued`, повтор | `attempt 2`, статус `queued`; после возврата S3 — `ready` | сценарий 13,8 с; потерь нет |
|
||||
| Каждая попытка — временная ошибка (`FAULT_POINT=transient_error`) | ровно 5 попыток, `failed retry_exhausted` | `attempt 5`, `retry_exhausted`, `409` на `/content` и в сообщении | 22,9 с до `failed`; бесконечного повтора нет |
|
||||
| Битый PNG (обрезан после IDAT) | `415` на входе или `invalid_image` без повторов | `415` на входе (API проверяет файл до `202`); с подменой staging в тесте — `invalid_image`, `attempt 1` | — |
|
||||
| Сообщение не по `jobs.schema.json` | в DLQ, worker жив | DLQ +1, очередь пуста (`test_rabbitmq.py`) | — |
|
||||
| Аренда истекла, старый держатель пытается зафиксировать | relay возвращает задание, старый — `fenced` | `queued`, `attempt 2`, затем `ready`; старая фиксация → `fenced`, вариантов не добавила (`test_pipeline.py`) | следующий проход relay (5 с) |
|
||||
| Брокер не подтвердил публикацию | строка outbox остаётся | `published_at IS NULL`, после восстановления публикуется (`test_pipeline.py`) | следующий опрос; потерь нет |
|
||||
| SIGTERM worker и relay | выход ≤10 с, код 0, unacked в очередь | 0,5 с, код 0 | — |
|
||||
| Перезапуск LB, API, relay, worker, PostgreSQL, Valkey, S3, broker с volumes | данные, сессия, вложение и байты на месте | `PASS: persistence …`, все `StartedAt` новее (повтор на `0b85edf`) | хранилища 00:33:04, relay и worker 00:33:22; потерь нет |
|
||||
| Остановка реплики API под записью | запись ≤10 с, без дублей | 3,0 с, 133 записи, 0 ошибок (повтор на `0b85edf`) | ≤3 с; потерь нет |
|
||||
| **4** Relay падает после взятия строки outbox, до publish (`after_commit_before_publish`) | exit 137, строка не опубликована, очередь пуста; после рестарта relay — `ready` без нового задания | exit 137, `published=false`, `[0, 0]`, `queued`; после запуска relay — `ready`, тот же `job_id` | сценарий 17,5 с вместе с рестартом; потерь нет |
|
||||
| **4** Relay падает после publish, до записи `published_at` | повторная публикация, дубль гасится | exit 137, строка не помечена; журнал `enqueued, claimed, done, duplicate_noop` | 15,7 с; потерь и второго эффекта нет |
|
||||
| **4** Worker падает после записи объектов в S3, до `COMMIT` | строк нет; повтор пишет те же ключи и фиксирует | exit 137, `processing`, 0 строк вариантов; `ready` на попытке 2, варианты совпадают с метаданными | 23,1 с (аренда 5 с + проход relay); потерь нет |
|
||||
| **4** Worker падает после `COMMIT`, до `ack` | `ready` уже есть; redelivery — no-op | exit 137, `ready`; redelivery → `duplicate_noop`, строки вариантов равны | 17,5 с; потерь нет |
|
||||
| **4** Worker завис после захвата на 15 с при аренде 5 с | relay возвращает задание, вторая попытка → `ready`, старый держатель — `fenced` | `claimed(1), lease_expired(2), claimed(2), done(2), fenced(1)`; снимок до и после пробуждения равен | 40,0 с (включая ожидание пробуждения); перезаписи нет |
|
||||
| **4** Рендер 40 Мпикс при `RENDER_TIMEOUT_SECONDS=0,5` и при `RENDER_MEMORY_MB=200` | `failed processing_failed` без повторов, worker жив | оба — `processing_failed`, `attempt 1`, контейнер `running`; со штатными пределами — `ready`, пик 379 MiB из 1024 MiB | 27,8 с на три загрузки |
|
||||
| **4** Каждая попытка — временная ошибка, задержки | задержки в `[d/2, d]`, разные доли | 0,69; 1,74; 2,83; 7,55 с при базе 1 с | 35,2 с до `failed` |
|
||||
| **4** Replay `failed`, затем повторный replay | `failed → queued → ready`; повтор для `ready` — `noop` без публикации | `replayed` → `ready` за <6 с; `noop`, событие `replay_noop`, варианты не изменились | 44,6 с вместе с исчерпанием попыток |
|
||||
| **4** Retention staging `failed` (1 с в сценарии) | staging хранится до retention, затем удаляется; replay → `expired` | staging был, удалён, `{"result": "expired"}`, статус `failed` не изменился | 41,8 с вместе с исчерпанием попыток |
|
||||
|
||||
## Ограничения и следующие шаги
|
||||
|
||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
||||
- Один Docker-host: RabbitMQ — один узел quorum-очереди без репликации, PostgreSQL и RustFS — единственные точки
|
||||
отказа; это не HA. Отказы — остановка и `SIGKILL` процессов и контейнеров, не сеть и не диск.
|
||||
- Это не exactly-once: брокер доставляет повторно (окна 3 и 5, redelivery после рестарта), дубли гасит захват
|
||||
задания и ключ эффекта. Publisher confirm подтверждает запись в очередь, consumer ack — устойчивый результат.
|
||||
- Relay держит транзакцию outbox на время публикации пачки; при недоступном брокере он каждую секунду ждёт
|
||||
таймаут соединения, API это не затрагивает, outbox растёт. LISTEN/NOTIFY не введён: опроса раз в секунду хватает
|
||||
бюджету smoke.
|
||||
- Ошибка PostgreSQL на захвате возвращает сообщение в очередь; после 10 возвратов оно уходит в DLQ, а задание
|
||||
остаётся `queued` с опубликованной строкой outbox. Replay работает только для `failed` (для `queued` — `noop`):
|
||||
такое сообщение оператор видит `make dlq` и возвращает из DLQ средствами брокера; автоматической
|
||||
переопубликации «застрявших» `queued` нет.
|
||||
- Задание, прерванное SIGTERM посреди рендера, вернётся только по истечении аренды (до 60 с): аренда при штатной
|
||||
остановке не освобождается. Эффекта и дубля нет, только задержка.
|
||||
- `RLIMIT_AS` применяется только в Linux: в собственных тестах на macOS проверяются таймаут, падение процесса рендера
|
||||
и `MemoryError`, а сам предел памяти — сценарием `worker_limits` на стенде.
|
||||
- Replay сбрасывает `attempt` в 1: оператор может повторять неудачную работу сколько угодно раз, каждый раз с записью
|
||||
`replayed` и именем оператора в журнале.
|
||||
- `optimized` теряет прозрачность (компоновка на белый, как у остальных вариантов).
|
||||
- `object_key` лабы 4 в `attachments` оставлен nullable до contract-миграции.
|
||||
- Нестабильность, найденная прогоном: проверка лабы 2 `test_valkey_restart_keeps_cache_and_revocations` один раз
|
||||
увидела на 1 ключ меньше после рестарта Valkey (между подсчётами истёк TTL кэшированной сессии); повтор — PASS.
|
||||
- Подтверждено прогонами: всё в таблице доказательств уровней «3» и «4». Трек 2 — следующее изменение.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
[alembic]
|
||||
script_location = %(here)s/alembic
|
||||
prepend_sys_path = %(here)s/src %(here)s/alembic
|
||||
path_separator = space
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
import asyncio
|
||||
|
||||
from alembic import context
|
||||
from alembic.script import ScriptDirectory
|
||||
from legacy import adopt_legacy
|
||||
from sqlalchemy import Connection, func, make_url, pool, select
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
|
||||
from messenger.attachments.infrastructure.postgres import (
|
||||
AttachmentRow,
|
||||
JobEventRow,
|
||||
JobRow,
|
||||
OutboxRow,
|
||||
VariantRow,
|
||||
)
|
||||
from messenger.identity.infrastructure.postgres import SessionRow, UserRow
|
||||
from messenger.messaging.infrastructure.postgres import (
|
||||
ChatMemberRow,
|
||||
ChatRow,
|
||||
IdempotencyKeyRow,
|
||||
MessageAttachmentRow,
|
||||
MessageRow,
|
||||
)
|
||||
from messenger.shared.config import PlatformSettings
|
||||
|
||||
LOCK_KEY = 20_260_002
|
||||
MODELS = (
|
||||
UserRow,
|
||||
SessionRow,
|
||||
ChatRow,
|
||||
ChatMemberRow,
|
||||
MessageRow,
|
||||
IdempotencyKeyRow,
|
||||
AttachmentRow,
|
||||
JobRow,
|
||||
OutboxRow,
|
||||
JobEventRow,
|
||||
VariantRow,
|
||||
MessageAttachmentRow,
|
||||
)
|
||||
target_metadata = UserRow.metadata
|
||||
config = context.config
|
||||
|
||||
|
||||
def include_object(_obj, name, _type, _reflected, _compare_to):
|
||||
return name != "schema_migrations"
|
||||
|
||||
|
||||
def run_migrations(connection: Connection) -> None:
|
||||
with connection.engine.connect() as lock:
|
||||
lock.execute(select(func.pg_advisory_lock(LOCK_KEY)))
|
||||
lock.commit()
|
||||
try:
|
||||
with connection.begin():
|
||||
adopt_legacy(connection, ScriptDirectory.from_config(config))
|
||||
context.configure(
|
||||
connection=connection,
|
||||
target_metadata=target_metadata,
|
||||
transaction_per_migration=True,
|
||||
compare_type=True,
|
||||
include_object=include_object,
|
||||
)
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
finally:
|
||||
lock.execute(select(func.pg_advisory_unlock(LOCK_KEY)))
|
||||
lock.commit()
|
||||
|
||||
|
||||
async def run_async_migrations() -> None:
|
||||
dsn = config.attributes.get("database_url")
|
||||
if dsn is None:
|
||||
dsn = PlatformSettings().database_url.get_secret_value()
|
||||
engine = create_async_engine(
|
||||
make_url(dsn).set(drivername="postgresql+asyncpg"),
|
||||
poolclass=pool.NullPool,
|
||||
hide_parameters=True,
|
||||
connect_args={
|
||||
"timeout": 10,
|
||||
"server_settings": {"lock_timeout": "10000", "statement_timeout": "60000"},
|
||||
},
|
||||
)
|
||||
try:
|
||||
async with engine.connect() as connection:
|
||||
await connection.run_sync(run_migrations)
|
||||
finally:
|
||||
await engine.dispose()
|
||||
|
||||
|
||||
if context.is_offline_mode():
|
||||
context.configure(
|
||||
dialect_name="postgresql",
|
||||
target_metadata=target_metadata,
|
||||
literal_binds=True,
|
||||
transaction_per_migration=True,
|
||||
)
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
elif config.attributes.get("connection") is not None:
|
||||
run_migrations(config.attributes["connection"])
|
||||
else:
|
||||
asyncio.run(run_async_migrations())
|
||||
@@ -0,0 +1,94 @@
|
||||
from uuid import uuid4
|
||||
|
||||
from alembic.migration import MigrationContext
|
||||
from alembic.operations import Operations
|
||||
from alembic.script import ScriptDirectory
|
||||
from sqlalchemy import Connection, MetaData, Table, func, inspect, select, text
|
||||
from sqlalchemy.schema import CreateSchema
|
||||
|
||||
LEGACY = {
|
||||
"0001_init": "9a13618f078ae9056431391e2e5197a31b981ae1fff047a9b3421ac750d3fd0d",
|
||||
"0002_idempotency_keys": "d9159a35553249a1e51af5f2e4e7c39b014e97593c49748e13f3799839063dd0",
|
||||
"0003_attachments": "c4417f560538a083efba1c67f660147dc94532fcbb2fa91f3f3e8258a0f01f2e",
|
||||
"0004_jobs": "c3887fa7a886ae8153a216aa43fd4c3c6190a2074e8ce20c3e77f29bfb01550e",
|
||||
"0005_failed_registry": "02b80061a08a6929feb092148c453ad970e3d001901c651b5a73b90b1e40f145",
|
||||
"0006_attachment_quarantine": (
|
||||
"541f5399d87fac3584c4102b4e0bf92c23cd372cc20a7d56dad03e771773202c"
|
||||
),
|
||||
}
|
||||
SNAPSHOT = text("""
|
||||
WITH relations AS (
|
||||
SELECT c.* FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE n.nspname = :schema AND c.relkind IN ('r', 'p')
|
||||
AND c.relname NOT IN ('schema_migrations', 'alembic_version')
|
||||
)
|
||||
SELECT 'table' AS kind, c.relname AS name,
|
||||
concat_ws('|', c.relkind, c.relpersistence,
|
||||
c.relrowsecurity, c.relforcerowsecurity) AS definition
|
||||
FROM relations c
|
||||
UNION ALL
|
||||
SELECT 'column', c.relname || '.' || a.attname,
|
||||
concat_ws('|', a.attnum, format_type(a.atttypid, a.atttypmod), a.attnotnull,
|
||||
a.attidentity, a.attgenerated, a.attcollation::regcollation,
|
||||
pg_get_expr(d.adbin, d.adrelid))
|
||||
FROM relations c JOIN pg_attribute a ON a.attrelid = c.oid
|
||||
LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = a.attnum
|
||||
WHERE a.attnum > 0 AND NOT a.attisdropped
|
||||
UNION ALL
|
||||
SELECT 'constraint', c.relname || '.' || k.conname,
|
||||
concat_ws('|', pg_get_constraintdef(k.oid), k.convalidated)
|
||||
FROM relations c JOIN pg_constraint k ON k.conrelid = c.oid
|
||||
UNION ALL
|
||||
SELECT 'index', c.relname || '.' || x.relname,
|
||||
concat_ws('|', pg_get_indexdef(i.indexrelid), i.indisvalid, i.indisready)
|
||||
FROM relations c JOIN pg_index i ON i.indrelid = c.oid
|
||||
JOIN pg_class x ON x.oid = i.indexrelid
|
||||
UNION ALL
|
||||
SELECT 'trigger', c.relname || '.' || t.tgname,
|
||||
concat_ws('|', pg_get_triggerdef(t.oid), t.tgenabled)
|
||||
FROM relations c JOIN pg_trigger t ON t.tgrelid = c.oid WHERE NOT t.tgisinternal
|
||||
ORDER BY kind, name
|
||||
""")
|
||||
|
||||
|
||||
def snapshot(connection: Connection, schema: str) -> list[tuple[str, str, str]]:
|
||||
return [
|
||||
(kind, name, definition.replace(f"{schema}.", ""))
|
||||
for kind, name, definition in connection.execute(SNAPSHOT, {"schema": schema})
|
||||
]
|
||||
|
||||
|
||||
def adopt_legacy(connection: Connection, scripts: ScriptDirectory) -> None:
|
||||
migration = MigrationContext.configure(connection)
|
||||
if migration.get_current_heads():
|
||||
return
|
||||
tables = set(inspect(connection).get_table_names(schema="public"))
|
||||
if tables <= {"alembic_version"}:
|
||||
return
|
||||
if "schema_migrations" not in tables:
|
||||
raise RuntimeError("Existing schema has no legacy migration journal")
|
||||
journal = Table("schema_migrations", MetaData(), schema="public", autoload_with=connection)
|
||||
applied = dict(connection.execute(select(journal.c.version, journal.c.checksum)).tuples().all())
|
||||
expected = dict(list(LEGACY.items())[: len(applied)])
|
||||
if applied != expected:
|
||||
raise RuntimeError("Unknown or changed legacy migrations")
|
||||
if not applied:
|
||||
if tables - {"schema_migrations", "alembic_version"}:
|
||||
raise RuntimeError("Existing schema has an empty migration journal")
|
||||
return
|
||||
revision = list(expected)[-1]
|
||||
actual = snapshot(connection, "public")
|
||||
reference = f"alembic_verify_{uuid4().hex}"
|
||||
savepoint = connection.begin_nested()
|
||||
try:
|
||||
connection.execute(CreateSchema(reference))
|
||||
connection.execute(select(func.set_config("search_path", reference, True)))
|
||||
with Operations.context(MigrationContext.configure(connection)):
|
||||
for script in reversed(list(scripts.walk_revisions(base="base", head=revision))):
|
||||
script.module.upgrade()
|
||||
wanted = snapshot(connection, reference)
|
||||
finally:
|
||||
savepoint.rollback()
|
||||
if actual != wanted:
|
||||
raise RuntimeError("Legacy schema differs from the recorded migrations")
|
||||
migration.stamp(scripts, revision)
|
||||
@@ -0,0 +1,16 @@
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
${imports if imports else ""}
|
||||
|
||||
revision = ${repr(up_revision)}
|
||||
down_revision = ${repr(down_revision)}
|
||||
branch_labels = ${repr(branch_labels)}
|
||||
depends_on = ${repr(depends_on)}
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
${upgrades if upgrades else "pass"}
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
${downgrades if downgrades else "pass"}
|
||||
@@ -0,0 +1,87 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0001_init"
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"users",
|
||||
sa.Column("id", sa.Uuid(), nullable=False),
|
||||
sa.Column("username", sa.Text(), nullable=False),
|
||||
sa.Column("display_name", sa.Text(), nullable=False),
|
||||
sa.Column("password_hash", sa.Text(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.CheckConstraint("password_hash LIKE '$argon2id$%'", name="users_password_hash_check"),
|
||||
sa.CheckConstraint("username ~ '^[a-z0-9_]{3,32}$'", name="users_username_format"),
|
||||
sa.CheckConstraint(
|
||||
"char_length(display_name) BETWEEN 1 AND 100", name="users_display_name_check"
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
sa.UniqueConstraint("username", name="users_username_key"),
|
||||
)
|
||||
op.create_table(
|
||||
"sessions",
|
||||
sa.Column("token_hash", sa.LargeBinary(), nullable=False),
|
||||
sa.Column("user_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("expires_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.CheckConstraint("expires_at > created_at", name="sessions_check"),
|
||||
sa.CheckConstraint("octet_length(token_hash) = 32", name="sessions_token_hash_check"),
|
||||
sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="CASCADE"),
|
||||
sa.PrimaryKeyConstraint("token_hash"),
|
||||
)
|
||||
op.create_index("sessions_user_idx", "sessions", ["user_id"], unique=False)
|
||||
op.create_table(
|
||||
"chats",
|
||||
sa.Column("id", sa.Uuid(), nullable=False),
|
||||
sa.Column("title", sa.Text(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("last_message_at", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.CheckConstraint("char_length(title) BETWEEN 1 AND 100", name="chats_title_check"),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
op.create_table(
|
||||
"chat_members",
|
||||
sa.Column("chat_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("user_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("position", sa.SmallInteger(), nullable=False),
|
||||
sa.Column("chat_created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.CheckConstraint("position BETWEEN 1 AND 100", name="chat_members_position_check"),
|
||||
sa.ForeignKeyConstraint(["chat_id"], ["chats.id"], ondelete="CASCADE"),
|
||||
sa.ForeignKeyConstraint(
|
||||
["user_id"],
|
||||
["users.id"],
|
||||
),
|
||||
sa.PrimaryKeyConstraint("chat_id", "user_id"),
|
||||
)
|
||||
op.create_index(
|
||||
"chat_members_user_idx",
|
||||
"chat_members",
|
||||
["user_id", "chat_created_at", "chat_id"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"messages",
|
||||
sa.Column("id", sa.Uuid(), nullable=False),
|
||||
sa.Column("chat_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("sender_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("text", sa.Text(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.CheckConstraint("char_length(text) BETWEEN 1 AND 4000", name="messages_text_check"),
|
||||
sa.ForeignKeyConstraint(
|
||||
["chat_id", "sender_id"],
|
||||
["chat_members.chat_id", "chat_members.user_id"],
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
op.create_index(
|
||||
"messages_history_idx", "messages", ["chat_id", "created_at", "id"], unique=False
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
raise RuntimeError("Downgrade would delete application data")
|
||||
@@ -0,0 +1,33 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0002_idempotency_keys"
|
||||
down_revision = "0001_init"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"idempotency_keys",
|
||||
sa.Column("chat_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("user_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("key", sa.Text(), nullable=False),
|
||||
sa.Column("fingerprint", sa.LargeBinary(), nullable=False),
|
||||
sa.Column("message_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.CheckConstraint("key ~ '^[A-Za-z0-9._:-]{1,128}$'", name="idempotency_keys_key_check"),
|
||||
sa.CheckConstraint(
|
||||
"octet_length(fingerprint) = 32", name="idempotency_keys_fingerprint_check"
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["chat_id", "user_id"],
|
||||
["chat_members.chat_id", "chat_members.user_id"],
|
||||
),
|
||||
sa.ForeignKeyConstraint(["message_id"], ["messages.id"], ondelete="CASCADE"),
|
||||
sa.PrimaryKeyConstraint("chat_id", "user_id", "key"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
raise RuntimeError("Downgrade would delete application data")
|
||||
@@ -0,0 +1,77 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0003_attachments"
|
||||
down_revision = "0002_idempotency_keys"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.drop_constraint("messages_text_check", "messages", type_="check")
|
||||
op.create_check_constraint("messages_text_check", "messages", "char_length(text) <= 4000")
|
||||
op.create_table(
|
||||
"attachments",
|
||||
sa.Column("id", sa.Uuid(), nullable=False),
|
||||
sa.Column("chat_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("owner_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("filename", sa.Text(), nullable=False),
|
||||
sa.Column("content_type", sa.Text(), nullable=False),
|
||||
sa.Column("size_bytes", sa.BigInteger(), nullable=False),
|
||||
sa.Column("sha256", sa.Text(), nullable=False),
|
||||
sa.Column("width", sa.Integer(), nullable=False),
|
||||
sa.Column("height", sa.Integer(), nullable=False),
|
||||
sa.Column("object_key", sa.Text(collation="C"), nullable=False),
|
||||
sa.Column("status", sa.Text(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
sa.UniqueConstraint("object_key", name="attachments_object_key_key"),
|
||||
sa.UniqueConstraint("id", "chat_id", name="attachments_chat_key"),
|
||||
sa.ForeignKeyConstraint(
|
||||
["chat_id", "owner_id"],
|
||||
["chat_members.chat_id", "chat_members.user_id"],
|
||||
name="attachments_owner_fkey",
|
||||
),
|
||||
sa.CheckConstraint(
|
||||
"char_length(filename) BETWEEN 1 AND 255", name="attachments_filename_check"
|
||||
),
|
||||
sa.CheckConstraint(
|
||||
"content_type IN ('image/png', 'image/jpeg')", name="attachments_content_type_check"
|
||||
),
|
||||
sa.CheckConstraint(
|
||||
"size_bytes BETWEEN 1 AND 10485760", name="attachments_size_bytes_check"
|
||||
),
|
||||
sa.CheckConstraint("sha256 ~ '^[0-9a-f]{64}$'", name="attachments_sha256_check"),
|
||||
sa.CheckConstraint("width > 0", name="attachments_width_check"),
|
||||
sa.CheckConstraint("height > 0", name="attachments_height_check"),
|
||||
sa.CheckConstraint("status IN ('pending', 'ready')", name="attachments_status_check"),
|
||||
)
|
||||
op.create_index(
|
||||
"attachments_pending_idx",
|
||||
"attachments",
|
||||
["created_at"],
|
||||
postgresql_where=sa.text("status = 'pending'"),
|
||||
)
|
||||
op.create_table(
|
||||
"message_attachments",
|
||||
sa.Column("message_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("position", sa.SmallInteger(), nullable=False),
|
||||
sa.Column("chat_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("attachment_id", sa.Uuid(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("message_id", "position"),
|
||||
sa.UniqueConstraint("message_id", "attachment_id"),
|
||||
sa.CheckConstraint("position BETWEEN 0 AND 9", name="message_attachments_position_check"),
|
||||
sa.ForeignKeyConstraint(["message_id"], ["messages.id"], ondelete="CASCADE"),
|
||||
sa.ForeignKeyConstraint(
|
||||
["attachment_id", "chat_id"],
|
||||
["attachments.id", "attachments.chat_id"],
|
||||
name="message_attachments_attachment_fkey",
|
||||
ondelete="RESTRICT",
|
||||
),
|
||||
)
|
||||
op.create_index("message_attachments_attachment_idx", "message_attachments", ["attachment_id"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
raise RuntimeError("Downgrade would delete application data")
|
||||
@@ -0,0 +1,146 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = "0004_jobs"
|
||||
down_revision = "0003_attachments"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.drop_constraint("attachments_status_check", "attachments", type_="check")
|
||||
op.create_check_constraint(
|
||||
"attachments_status_check",
|
||||
"attachments",
|
||||
"status IN ('pending', 'queued', 'processing', 'ready', 'failed')",
|
||||
)
|
||||
for name in ("staging_key", "original_key"):
|
||||
op.add_column("attachments", sa.Column(name, sa.Text(collation="C"), nullable=True))
|
||||
op.create_unique_constraint(f"attachments_{name}_key", "attachments", [name])
|
||||
op.add_column(
|
||||
"attachments",
|
||||
sa.Column("published_version", sa.Integer(), nullable=False, server_default="0"),
|
||||
)
|
||||
op.create_check_constraint(
|
||||
"attachments_published_version_check", "attachments", "published_version >= 0"
|
||||
)
|
||||
op.add_column("attachments", sa.Column("error_code", sa.Text(), nullable=True))
|
||||
op.create_check_constraint(
|
||||
"attachments_error_code_check",
|
||||
"attachments",
|
||||
"error_code IN ('invalid_image', 'processing_failed', 'retry_exhausted')",
|
||||
)
|
||||
op.alter_column("attachments", "object_key", nullable=True)
|
||||
attachments = sa.table(
|
||||
"attachments",
|
||||
sa.column("status"),
|
||||
sa.column("object_key"),
|
||||
sa.column("original_key"),
|
||||
sa.column("staging_key"),
|
||||
sa.column("published_version"),
|
||||
)
|
||||
op.execute(
|
||||
attachments.update()
|
||||
.where(attachments.c.status == "ready")
|
||||
.values(original_key=attachments.c.object_key, published_version=1)
|
||||
)
|
||||
op.execute(
|
||||
attachments.update()
|
||||
.where(attachments.c.status == "pending")
|
||||
.values(staging_key=attachments.c.object_key)
|
||||
)
|
||||
op.create_index(
|
||||
"attachments_staged_idx",
|
||||
"attachments",
|
||||
["updated_at"],
|
||||
postgresql_where=sa.column("staging_key").is_not(None),
|
||||
)
|
||||
op.create_table(
|
||||
"attachment_variants",
|
||||
sa.Column("attachment_id", sa.Uuid(), sa.ForeignKey("attachments.id"), nullable=False),
|
||||
sa.Column("pipeline_version", sa.Integer(), nullable=False),
|
||||
sa.Column("name", sa.Text(), nullable=False),
|
||||
sa.Column("object_key", sa.Text(collation="C"), nullable=False),
|
||||
sa.Column("content_type", sa.Text(), nullable=False),
|
||||
sa.Column("size_bytes", sa.BigInteger(), nullable=False),
|
||||
sa.Column("width", sa.Integer(), nullable=False),
|
||||
sa.Column("height", sa.Integer(), nullable=False),
|
||||
sa.Column("sha256", sa.Text(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.PrimaryKeyConstraint("attachment_id", "pipeline_version", "name"),
|
||||
sa.UniqueConstraint("object_key", name="attachment_variants_object_key_key"),
|
||||
sa.CheckConstraint(
|
||||
"pipeline_version >= 1", name="attachment_variants_pipeline_version_check"
|
||||
),
|
||||
sa.CheckConstraint(
|
||||
"name IN ('thumbnail', 'crop', 'optimized')", name="attachment_variants_name_check"
|
||||
),
|
||||
sa.CheckConstraint(
|
||||
"content_type IN ('image/jpeg', 'image/png', 'image/webp')",
|
||||
name="attachment_variants_content_type_check",
|
||||
),
|
||||
sa.CheckConstraint("size_bytes >= 1", name="attachment_variants_size_bytes_check"),
|
||||
sa.CheckConstraint("width >= 1", name="attachment_variants_width_check"),
|
||||
sa.CheckConstraint("height >= 1", name="attachment_variants_height_check"),
|
||||
sa.CheckConstraint("sha256 ~ '^[0-9a-f]{64}$'", name="attachment_variants_sha256_check"),
|
||||
)
|
||||
op.create_table(
|
||||
"jobs",
|
||||
sa.Column("job_id", sa.Uuid(), primary_key=True),
|
||||
sa.Column("attachment_id", sa.Uuid(), sa.ForeignKey("attachments.id"), nullable=False),
|
||||
sa.Column("pipeline_version", sa.Integer(), nullable=False),
|
||||
sa.Column("status", sa.Text(), nullable=False),
|
||||
sa.Column("attempt", sa.Integer(), nullable=False),
|
||||
sa.Column("claims", sa.Integer(), nullable=False, server_default="0"),
|
||||
sa.Column("lease_token", sa.Uuid(), nullable=True),
|
||||
sa.Column("lease_until", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column("next_attempt_at", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column("last_error", sa.Text(), nullable=True),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.UniqueConstraint("attachment_id", "pipeline_version", name="jobs_effect_key"),
|
||||
sa.CheckConstraint("pipeline_version >= 1", name="jobs_pipeline_version_check"),
|
||||
sa.CheckConstraint(
|
||||
"status IN ('queued', 'processing', 'done', 'failed', 'superseded')",
|
||||
name="jobs_status_check",
|
||||
),
|
||||
sa.CheckConstraint("attempt >= 1", name="jobs_attempt_check"),
|
||||
sa.CheckConstraint("claims >= 0", name="jobs_claims_check"),
|
||||
)
|
||||
op.create_index(
|
||||
"jobs_lease_idx",
|
||||
"jobs",
|
||||
["lease_until"],
|
||||
postgresql_where=sa.column("status") == "processing",
|
||||
)
|
||||
op.create_table(
|
||||
"outbox",
|
||||
sa.Column("id", sa.BigInteger(), sa.Identity(always=True), primary_key=True),
|
||||
sa.Column("job_id", sa.Uuid(), sa.ForeignKey("jobs.job_id"), nullable=False),
|
||||
sa.Column("payload", postgresql.JSONB(), nullable=False),
|
||||
sa.Column("available_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("published_at", sa.DateTime(timezone=True), nullable=True),
|
||||
)
|
||||
op.create_index(
|
||||
"outbox_pending_idx",
|
||||
"outbox",
|
||||
["available_at", "id"],
|
||||
postgresql_where=sa.column("published_at").is_(None),
|
||||
)
|
||||
op.create_index("outbox_job_idx", "outbox", ["job_id"])
|
||||
op.create_table(
|
||||
"job_events",
|
||||
sa.Column("id", sa.BigInteger(), sa.Identity(always=True), primary_key=True),
|
||||
sa.Column("job_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("attachment_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("kind", sa.Text(), nullable=False),
|
||||
sa.Column("attempt", sa.Integer(), nullable=True),
|
||||
sa.Column("detail", postgresql.JSONB(), nullable=False, server_default="{}"),
|
||||
sa.Column("at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()),
|
||||
)
|
||||
op.create_index("job_events_attachment_idx", "job_events", ["attachment_id", "id"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
raise RuntimeError("Downgrade would delete pipeline data")
|
||||
@@ -0,0 +1,20 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0005_failed_registry"
|
||||
down_revision = "0004_jobs"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_index(
|
||||
"jobs_failed_idx",
|
||||
"jobs",
|
||||
[sa.column("updated_at").desc()],
|
||||
postgresql_where=sa.column("status") == "failed",
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("jobs_failed_idx", table_name="jobs")
|
||||
@@ -0,0 +1,28 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0006_attachment_quarantine"
|
||||
down_revision = "0005_failed_registry"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("attachments", sa.Column("quarantine_reason", sa.Text(), nullable=True))
|
||||
op.create_check_constraint(
|
||||
"attachments_quarantine_reason_check",
|
||||
"attachments",
|
||||
"quarantine_reason IN ('missing', 'size_mismatch', 'sha_mismatch')",
|
||||
)
|
||||
op.add_column(
|
||||
"attachments", sa.Column("quarantined_at", sa.DateTime(timezone=True), nullable=True)
|
||||
)
|
||||
op.create_check_constraint(
|
||||
"attachments_quarantine_check",
|
||||
"attachments",
|
||||
"(quarantine_reason IS NULL) = (quarantined_at IS NULL)",
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
raise RuntimeError("Downgrade would delete quarantine data")
|
||||
+446
@@ -0,0 +1,446 @@
|
||||
x-app: &app
|
||||
image: ${API_IMAGE:-mtusi-messenger:${COMPOSE_PROJECT_NAME}}
|
||||
networks: [backend]
|
||||
|
||||
x-s3-env: &s3-env
|
||||
S3_ENDPOINT: ${S3_ENDPOINT:-http://s3:9000}
|
||||
S3_REGION: ${S3_REGION:-us-east-1}
|
||||
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
|
||||
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_access_key_id
|
||||
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_secret_access_key
|
||||
S3_CONNECT_TIMEOUT_SECONDS: ${S3_CONNECT_TIMEOUT_SECONDS:-1}
|
||||
S3_READ_TIMEOUT_SECONDS: ${S3_READ_TIMEOUT_SECONDS:-2}
|
||||
MAX_UPLOAD_BYTES: ${MAX_UPLOAD_BYTES:-10485760}
|
||||
MAX_IMAGE_PIXELS: ${MAX_IMAGE_PIXELS:-40000000}
|
||||
IMAGE_CHECK_CONCURRENCY: ${IMAGE_CHECK_CONCURRENCY:-2}
|
||||
UPLOAD_CONCURRENCY: ${UPLOAD_CONCURRENCY:-3}
|
||||
UPLOAD_GRACE_SECONDS: ${UPLOAD_GRACE_SECONDS:-900}
|
||||
UPLOAD_SWEEP_INTERVAL_SECONDS: ${UPLOAD_SWEEP_INTERVAL_SECONDS:-30}
|
||||
UPLOAD_SWEEP_BATCH: ${UPLOAD_SWEEP_BATCH:-100}
|
||||
|
||||
x-pipeline: &pipeline
|
||||
image: ${API_IMAGE:-mtusi-messenger:${COMPOSE_PROJECT_NAME}}
|
||||
pull_policy: never
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
read_only: true
|
||||
tmpfs: [/tmp]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
cap_drop: [ALL]
|
||||
stop_grace_period: 10s
|
||||
networks: [backend]
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import os,sys,time;sys.exit(time.time()-os.stat('/tmp/heartbeat').st_mtime>30)"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
start_interval: 2s
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
s3-init:
|
||||
condition: service_completed_successfully
|
||||
broker:
|
||||
condition: service_healthy
|
||||
|
||||
x-pipeline-env: &pipeline-env
|
||||
<<: *s3-env
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
BROKER_URL_FILE: /run/secrets/broker_url
|
||||
DB_POOL_MAX_SIZE: ${PIPELINE_DB_POOL_MAX_SIZE:-4}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
||||
HEARTBEAT_FILE: /tmp/heartbeat
|
||||
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
|
||||
JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-60}
|
||||
JOB_BACKOFF_BASE_SECONDS: ${JOB_BACKOFF_BASE_SECONDS:-2}
|
||||
STAGING_RETENTION_SECONDS: ${STAGING_RETENTION_SECONDS:-86400}
|
||||
|
||||
x-s3-client: &s3-client
|
||||
image: rustfs/rc:v0.1.36@sha256:ab024bfebee49a750ce886b4c70963ccd9ddaa03f491704a90710641d7a26699
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:size=16m"]
|
||||
environment:
|
||||
S3_ENDPOINT: ${S3_ENDPOINT:-http://s3:9000}
|
||||
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
|
||||
RC_CONFIG_DIR: /tmp/rc
|
||||
user: "65534:65534"
|
||||
volumes: ["./infra/s3:/s3:ro"]
|
||||
secrets:
|
||||
- s3_root_user
|
||||
- s3_root_password
|
||||
- s3_access_key_id
|
||||
- s3_secret_access_key
|
||||
- s3_reconciler_access_key_id
|
||||
- s3_reconciler_secret_access_key
|
||||
- s3_worker_access_key_id
|
||||
- s3_worker_secret_access_key
|
||||
cap_drop: [ALL]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
restart: "no"
|
||||
networks: [backend]
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.5", memory: 64m}
|
||||
|
||||
services:
|
||||
lb:
|
||||
image: haproxy:3.2.26-alpine@sha256:5893840576071e6217cd52ebdcc14f454c6f7a631056fa6f4e0f40d3cac4215b
|
||||
environment:
|
||||
API_SERVER_MAXCONN: ${API_SERVER_MAXCONN:-64}
|
||||
volumes: [./infra/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro]
|
||||
ports:
|
||||
- "127.0.0.1:${LB_HTTP_PORT:-18085}:8080"
|
||||
- "127.0.0.1:${LB_STATS_PORT:-25085}:8404"
|
||||
networks: [edge, backend]
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8404/healthz"]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
start_interval: 1s
|
||||
sysctls:
|
||||
net.ipv4.ip_local_port_range: "10240 65535"
|
||||
net.ipv4.tcp_tw_reuse: "1"
|
||||
stop_signal: SIGUSR1
|
||||
stop_grace_period: 8s
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
cap_drop: [ALL]
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "${LB_CPUS:-1}", memory: 128m}
|
||||
|
||||
api:
|
||||
<<: *app
|
||||
build: .
|
||||
environment:
|
||||
<<: *s3-env
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
CACHE_URL_FILE: /run/secrets/cache_url
|
||||
CURSOR_SECRET_FILE: /run/secrets/cursor_secret
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
IDEMPOTENCY_TTL_SECONDS: ${IDEMPOTENCY_TTL_SECONDS:-86400}
|
||||
WEB_CONCURRENCY: ${WEB_CONCURRENCY:-2}
|
||||
DB_POOL_MAX_SIZE: ${DB_POOL_MAX_SIZE:-8}
|
||||
REQUEST_TIMEOUT_SECONDS: ${REQUEST_TIMEOUT_SECONDS:-8}
|
||||
MIN_TRANSFER_RATE_BYTES: ${MIN_TRANSFER_RATE_BYTES:-131072}
|
||||
DB_ACQUIRE_TIMEOUT_SECONDS: ${DB_ACQUIRE_TIMEOUT_SECONDS:-1}
|
||||
DB_COMMAND_TIMEOUT_SECONDS: ${DB_COMMAND_TIMEOUT_SECONDS:-2}
|
||||
DRAIN_SECONDS: ${DRAIN_SECONDS:-2}
|
||||
SHUTDOWN_TIMEOUT_SECONDS: ${SHUTDOWN_TIMEOUT_SECONDS:-6}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
||||
MALLOC_MMAP_THRESHOLD_: ${MALLOC_MMAP_THRESHOLD_:-131072}
|
||||
secrets: [database_url, cache_url, cursor_secret, s3_access_key_id, s3_secret_access_key]
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200)"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
start_interval: 200ms
|
||||
stop_grace_period: 8s
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
tmpfs: [/tmp]
|
||||
sysctls:
|
||||
net.ipv4.tcp_rmem: "4096 65536 262144"
|
||||
net.ipv4.tcp_wmem: "4096 65536 262144"
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
valkey:
|
||||
condition: service_started
|
||||
s3-init:
|
||||
condition: service_completed_successfully
|
||||
deploy:
|
||||
replicas: ${API_REPLICAS:-2}
|
||||
resources:
|
||||
limits: {cpus: "${API_CPUS:-1}", memory: "${API_MEMORY:-512m}"}
|
||||
|
||||
migrate:
|
||||
<<: *app
|
||||
pull_policy: never
|
||||
init: true
|
||||
command: ["alembic", "upgrade", "head"]
|
||||
environment:
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
||||
secrets: [database_url]
|
||||
healthcheck:
|
||||
disable: true
|
||||
restart: "no"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.5", memory: 256m}
|
||||
|
||||
postgres:
|
||||
image: postgres:17.11-alpine@sha256:266d3c257594e195b309ae9d1805e54c788f1d7b375f56bf6c367aac6c917e7b
|
||||
user: "70:70"
|
||||
command:
|
||||
- postgres
|
||||
- -c
|
||||
- max_connections=${PG_MAX_CONNECTIONS:-200}
|
||||
- -c
|
||||
- shared_buffers=${PG_SHARED_BUFFERS:-256MB}
|
||||
- -c
|
||||
- shared_preload_libraries=pg_stat_statements
|
||||
- -c
|
||||
- pg_stat_statements.track=top
|
||||
- -c
|
||||
- track_io_timing=on
|
||||
- -c
|
||||
- idle_in_transaction_session_timeout=10s
|
||||
environment:
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
secrets: [postgres_password]
|
||||
volumes: [pgdata:/var/lib/postgresql/data]
|
||||
shm_size: 256m
|
||||
cpuset: ${PG_CPUSET:-}
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-h", "127.0.0.1", "-U", "messenger", "-d", "messenger"]
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
start_period: 10s
|
||||
start_interval: 200ms
|
||||
stop_grace_period: 10s
|
||||
restart: unless-stopped
|
||||
networks: [backend]
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "${PG_CPUS:-2}", memory: "${PG_MEMORY:-1g}"}
|
||||
|
||||
valkey:
|
||||
image: valkey/valkey:8.1.11-alpine@sha256:2602ace2be6569bc2bbb06f873776516ab9089821525be34f4305c67eb9db02a
|
||||
user: "999:1000"
|
||||
command:
|
||||
- valkey-server
|
||||
- /run/secrets/valkey.conf
|
||||
- --appendonly
|
||||
- "yes"
|
||||
- --appendfsync
|
||||
- always
|
||||
- --maxmemory
|
||||
- 64mb
|
||||
- --maxmemory-policy
|
||||
- volatile-lru
|
||||
secrets: [valkey.conf]
|
||||
volumes: [valkeydata:/data]
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "REDISCLI_AUTH=\"$$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)\" valkey-cli ping | grep -q PONG"]
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
stop_grace_period: 10s
|
||||
restart: unless-stopped
|
||||
networks: [backend]
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.5", memory: 128m}
|
||||
|
||||
s3:
|
||||
image: rustfs/rustfs:1.0.4@sha256:ed9210d6411d77ffceb70d94b964a3cb7d225983368bc25bebe01e995293dcc2
|
||||
environment:
|
||||
RUSTFS_ACCESS_KEY_FILE: /run/secrets/s3_root_user
|
||||
RUSTFS_SECRET_KEY_FILE: /run/secrets/s3_root_password
|
||||
RUSTFS_ADDRESS: ":9000"
|
||||
RUSTFS_CONSOLE_ENABLE: "false"
|
||||
RUSTFS_REGION: ${S3_REGION:-us-east-1}
|
||||
RUSTFS_OBS_LOG_DIRECTORY: ""
|
||||
RUSTFS_OBS_LOGGER_LEVEL: ${S3_LOG_LEVEL:-warn}
|
||||
secrets: [s3_root_user, s3_root_password]
|
||||
volumes: [s3data:/data]
|
||||
cpuset: ${S3_CPUSET:-}
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:size=64m"]
|
||||
cap_drop: [ALL]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "-o", "/dev/null", "http://127.0.0.1:9000/health/ready"]
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
start_period: 20s
|
||||
stop_grace_period: 10s
|
||||
restart: unless-stopped
|
||||
networks: [backend]
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "${S3_CPUS:-1}", memory: "${S3_MEMORY:-512m}"}
|
||||
|
||||
reconciler:
|
||||
<<: *app
|
||||
pull_policy: never
|
||||
profiles: [reconcile]
|
||||
init: true
|
||||
entrypoint: ["python", "-m", "messenger.attachments.entrypoints.reconcile"]
|
||||
command: ["--dry-run"]
|
||||
environment:
|
||||
<<: *s3-env
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_reconciler_access_key_id
|
||||
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_reconciler_secret_access_key
|
||||
S3_READ_TIMEOUT_SECONDS: ${RECONCILE_S3_READ_TIMEOUT_SECONDS:-10}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
||||
secrets: [database_url, s3_reconciler_access_key_id, s3_reconciler_secret_access_key]
|
||||
healthcheck:
|
||||
disable: true
|
||||
restart: "no"
|
||||
read_only: true
|
||||
cpuset: ${RECONCILE_CPUSET:-}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
s3:
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "${RECONCILE_CPUS:-1}", memory: "${RECONCILE_MEMORY:-256m}"}
|
||||
|
||||
s3-init:
|
||||
<<: *s3-client
|
||||
entrypoint: ["/bin/sh", "/s3/init.sh"]
|
||||
depends_on:
|
||||
s3:
|
||||
condition: service_healthy
|
||||
|
||||
s3-cli:
|
||||
<<: *s3-client
|
||||
profiles: [tools]
|
||||
entrypoint: ["/bin/sh", "/s3/cli.sh"]
|
||||
|
||||
broker:
|
||||
image: rabbitmq:4.1.8-management-alpine@sha256:54ef5ff505352c1beef05a97ee9bd6ab95b3559a76629ba0119b1d63d8d6e4b2
|
||||
hostname: broker
|
||||
user: "100:101"
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
tmpfs: [/tmp]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
cap_drop: [ALL]
|
||||
ports:
|
||||
- "127.0.0.1:${BROKER_MANAGEMENT_PORT:-25086}:15672"
|
||||
networks: [backend, edge]
|
||||
volumes:
|
||||
- broker-data:/var/lib/rabbitmq
|
||||
- ./infra/rabbitmq/rabbitmq.conf:/etc/rabbitmq/conf.d/20-messenger.conf:ro
|
||||
- ./infra/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
||||
- ./infra/rabbitmq/definitions.json:/etc/rabbitmq/definitions.d/10-topology.json:ro
|
||||
secrets:
|
||||
- source: rabbitmq_users
|
||||
target: /etc/rabbitmq/definitions.d/20-users.json
|
||||
- rabbitmq_ops_password
|
||||
healthcheck:
|
||||
test: ["CMD", "rabbitmq-diagnostics", "-q", "check_port_connectivity"]
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
start_interval: 2s
|
||||
stop_grace_period: 10s
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "1", memory: 512m}
|
||||
|
||||
relay:
|
||||
<<: *pipeline
|
||||
command: ["python", "-m", "messenger.relay"]
|
||||
environment:
|
||||
<<: *pipeline-env
|
||||
OUTBOX_POLL_SECONDS: ${OUTBOX_POLL_SECONDS:-1}
|
||||
SWEEP_INTERVAL_SECONDS: ${SWEEP_INTERVAL_SECONDS:-5}
|
||||
secrets:
|
||||
- database_url
|
||||
- source: broker_url_api
|
||||
target: broker_url
|
||||
- s3_access_key_id
|
||||
- s3_secret_access_key
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.5", memory: 192m}
|
||||
|
||||
worker:
|
||||
<<: *pipeline
|
||||
command: ["python", "-m", "messenger.worker"]
|
||||
environment:
|
||||
<<: *pipeline-env
|
||||
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-2}
|
||||
RENDER_TIMEOUT_SECONDS: ${RENDER_TIMEOUT_SECONDS:-30}
|
||||
RENDER_MEMORY_MB: ${RENDER_MEMORY_MB:-448}
|
||||
RENDER_TASKS_PER_CHILD: ${RENDER_TASKS_PER_CHILD:-100}
|
||||
secrets:
|
||||
- database_url
|
||||
- source: broker_url_worker
|
||||
target: broker_url
|
||||
- source: s3_worker_access_key_id
|
||||
target: s3_access_key_id
|
||||
- source: s3_worker_secret_access_key
|
||||
target: s3_secret_access_key
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "${WORKER_CPUS:-2}", memory: "${WORKER_MEMORY:-1g}"}
|
||||
|
||||
k6:
|
||||
image: grafana/k6:2.3.0@sha256:2dd4756ec6e14e62778916e1eb850108e4b499304c02df56760fa0bdb0fba0b8
|
||||
profiles: [bench]
|
||||
environment:
|
||||
BASE_URL: http://lb:8080
|
||||
volumes: [./infra/k6:/scripts:ro]
|
||||
networks: [edge]
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "${K6_CPUS:-2}", memory: "${K6_MEMORY:-512m}"}
|
||||
|
||||
secrets:
|
||||
postgres_password:
|
||||
file: ./secrets/postgres_password
|
||||
database_url:
|
||||
file: ./secrets/database_url
|
||||
valkey.conf:
|
||||
file: ./secrets/valkey.conf
|
||||
cache_url:
|
||||
file: ./secrets/cache_url
|
||||
cursor_secret:
|
||||
file: ./secrets/cursor_secret
|
||||
s3_root_user:
|
||||
file: ./secrets/s3_root_user
|
||||
s3_root_password:
|
||||
file: ./secrets/s3_root_password
|
||||
s3_access_key_id:
|
||||
file: ./secrets/s3_access_key_id
|
||||
s3_secret_access_key:
|
||||
file: ./secrets/s3_secret_access_key
|
||||
s3_worker_access_key_id:
|
||||
file: ./secrets/s3_worker_access_key_id
|
||||
s3_worker_secret_access_key:
|
||||
file: ./secrets/s3_worker_secret_access_key
|
||||
rabbitmq_users:
|
||||
file: ./secrets/rabbitmq_users.json
|
||||
rabbitmq_ops_password:
|
||||
file: ./secrets/rabbitmq_ops_password
|
||||
broker_url_api:
|
||||
file: ./secrets/broker_url_api
|
||||
broker_url_worker:
|
||||
file: ./secrets/broker_url_worker
|
||||
s3_reconciler_access_key_id:
|
||||
file: ./secrets/s3_reconciler_access_key_id
|
||||
s3_reconciler_secret_access_key:
|
||||
file: ./secrets/s3_reconciler_secret_access_key
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
valkeydata:
|
||||
s3data:
|
||||
broker-data:
|
||||
|
||||
networks:
|
||||
edge:
|
||||
backend:
|
||||
internal: true
|
||||
@@ -0,0 +1,14 @@
|
||||
date: 2026-10-29T00:36:33Z commit: 0b85edf
|
||||
$ make check
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
$ make validate PYTHON=<venv с requirements-dev.txt>
|
||||
<venv>/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
$ make lint
|
||||
.venv/bin/ruff check src student-tests scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
All checks passed!
|
||||
.venv/bin/ruff format --check src student-tests scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
159 files already formatted
|
||||
.venv/bin/ty check src student-tests
|
||||
All checks passed!
|
||||
@@ -0,0 +1,58 @@
|
||||
date: 2026-10-29T00:36:34Z commit: 0b85edf
|
||||
host: Apple M4 Max, 16 CPU, 48 GiB RAM, macOS 15.1
|
||||
docker: 28.3.2, VM: 16 CPU, 8217190400 bytes
|
||||
compose: 2.38.2-desktop.1
|
||||
images:
|
||||
image: ${API_IMAGE:-mtusi-messenger:lab5}
|
||||
image: ${API_IMAGE:-mtusi-messenger:lab5}
|
||||
image: rustfs/rc:v0.1.36@sha256:ab024bfebee49a750ce886b4c70963ccd9ddaa03f491704a90710641d7a26699
|
||||
image: haproxy:3.2.26-alpine@sha256:5893840576071e6217cd52ebdcc14f454c6f7a631056fa6f4e0f40d3cac4215b
|
||||
image: postgres:17.11-alpine@sha256:266d3c257594e195b309ae9d1805e54c788f1d7b375f56bf6c367aac6c917e7b
|
||||
image: valkey/valkey:8.1.11-alpine@sha256:2602ace2be6569bc2bbb06f873776516ab9089821525be34f4305c67eb9db02a
|
||||
image: rustfs/rustfs:1.0.4@sha256:ed9210d6411d77ffceb70d94b964a3cb7d225983368bc25bebe01e995293dcc2
|
||||
image: rabbitmq:4.1.8-management-alpine@sha256:54ef5ff505352c1beef05a97ee9bd6ab95b3559a76629ba0119b1d63d8d6e4b2
|
||||
image: grafana/k6:2.3.0@sha256:2dd4756ec6e14e62778916e1eb850108e4b499304c02df56760fa0bdb0fba0b8
|
||||
FROM python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d AS builder
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
FROM python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d AS runtime
|
||||
python in image: Python 3.14.7
|
||||
haproxy: HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/
|
||||
rustfs: rustfs 1.0.4
|
||||
rabbitmq: 4.1.8
|
||||
packages (uv.lock):
|
||||
fastapi 0.141.1
|
||||
uvicorn 0.54.0
|
||||
uvicorn-worker 0.4.0
|
||||
gunicorn 26.2.0
|
||||
asyncpg 0.32.0
|
||||
argon2-cffi 25.1.0
|
||||
pydantic 2.13.5
|
||||
pydantic-settings 2.15.0
|
||||
dishka 1.10.1
|
||||
structlog 26.1.0
|
||||
redis 8.1.0
|
||||
aiobotocore 3.10.0
|
||||
botocore 1.43.117
|
||||
aiohttp 3.14.5
|
||||
pillow 13.0.0
|
||||
faststream 0.7.8
|
||||
aio-pika 10.2.1
|
||||
aiormq 7.2.4
|
||||
dishka-faststream 0.7.0
|
||||
process users (service uid command):
|
||||
api 10001 python
|
||||
broker 100 beam.smp
|
||||
broker 100 epmd
|
||||
broker 100 erl_child_setup
|
||||
broker 100 inet_gethost
|
||||
broker 100 sh
|
||||
lb 99 haproxy
|
||||
postgres 70 postgres
|
||||
relay 10001 docker-init
|
||||
relay 10001 python
|
||||
s3 10001 rustfs
|
||||
valkey 999 tini
|
||||
valkey 999 valkey-server
|
||||
worker 10001 docker-init
|
||||
worker 10001 python
|
||||
worker limits: 2 CPU, memory.max 1024 MiB; render: WORKER_CONCURRENCY=2 processes, RLIMIT_AS 448 MiB, timeout 30 s, 100 tasks per process
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"ok": true,
|
||||
"scenario": "failover-upload",
|
||||
"upload_instance": "70cfba801128",
|
||||
"download_instance": "095cb9cc85bd",
|
||||
"sha256_equal": true,
|
||||
"hook_seconds": 2.877,
|
||||
"download_ok_after_seconds": 2.886,
|
||||
"restored": true
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
date: 2026-10-29T00:33:32Z commit: 0b85edf
|
||||
== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt
|
||||
095cb9cc85bd running started=2026-10-29T00:33:12.427394173Z finished=2026-10-29T00:33:03.853644169Z
|
||||
70cfba801128 running started=2026-10-29T00:33:12.607365173Z finished=2026-10-29T00:33:03.666460502Z
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:18085"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 133, "failed_attempts": 0, "first_recovery_seconds": 3.005}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
== after: api replicas
|
||||
095cb9cc85bd running started=2026-10-29T00:33:12.427394173Z finished=2026-10-29T00:33:03.853644169Z
|
||||
70cfba801128 exited started=2026-10-29T00:33:12.607365173Z finished=2026-10-29T00:33:39.052027754Z
|
||||
== stopped replica: 70cfba801128; shutdown: signal, drain window with readiness 503, close, exit
|
||||
{"event":"Handling signal: term","level":"info","ts":"2026-10-29T00:33:36.479119Z"}
|
||||
{"event":"Draining for 2.0 s","level":"info","ts":"2026-10-29T00:33:36.486455Z"}
|
||||
{"event":"Draining for 2.0 s","level":"info","ts":"2026-10-29T00:33:36.558375Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"b3d9118f93b94471b698d536dda11072","duration_ms":0.772,"event":"request.handled","level":"info","ts":"2026-10-29T00:33:37.011026Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"3c1324def7e74f3484c4fbd242f7f70b","duration_ms":0.655,"event":"request.handled","level":"info","ts":"2026-10-29T00:33:37.515877Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"e56c9504272b45a89b7372020eb80d15","duration_ms":0.733,"event":"request.handled","level":"info","ts":"2026-10-29T00:33:37.588547Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-10-29T00:33:38.487910Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-10-29T00:33:38.560300Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-10-29T00:33:38.592638Z"}
|
||||
{"event":"Finished server process [13]","level":"info","ts":"2026-10-29T00:33:38.592934Z"}
|
||||
{"event":"Worker (pid:13) was sent SIGTERM!","level":"info","ts":"2026-10-29T00:33:38.624866Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-10-29T00:33:38.664775Z"}
|
||||
{"event":"Finished server process [14]","level":"info","ts":"2026-10-29T00:33:38.665027Z"}
|
||||
{"event":"Worker (pid:14) was sent SIGTERM!","level":"info","ts":"2026-10-29T00:33:38.725950Z"}
|
||||
{"event":"Shutting down: Master","level":"info","ts":"2026-10-29T00:33:38.834487Z"}
|
||||
$ scripts/restore.sh
|
||||
Container mtusi2026lab5-api-1 Running
|
||||
Container mtusi2026lab5-api-2 Starting
|
||||
Container mtusi2026lab5-api-2 Started
|
||||
Container mtusi2026lab5-api-1 Waiting
|
||||
Container mtusi2026lab5-api-2 Waiting
|
||||
Container mtusi2026lab5-api-1 Healthy
|
||||
Container mtusi2026lab5-api-2 Healthy
|
||||
== after restore
|
||||
095cb9cc85bd running started=2026-10-29T00:33:12.427394173Z finished=2026-10-29T00:33:03.853644169Z
|
||||
70cfba801128 running started=2026-10-29T00:33:51.687259594Z finished=2026-10-29T00:33:39.052027754Z
|
||||
@@ -0,0 +1,57 @@
|
||||
# Повторная квалификация после позднего forward
|
||||
|
||||
Runtime: `0e921116610d289716af0a40ec823376eb8bbcbc`. Источник: `d7478726a85791c21e065d58f610735a9e687433..4ed889c1e4008e3f6040ae2534bef99262d3b8ce`, только immutable snapshot. Полная судьба 253 файлов — ../forward-port.md и source-inventory.json. REPORT.md не изменён: это материалы следующему агенту отчёта.
|
||||
|
||||
## Гипотеза и методика
|
||||
|
||||
Поздние исправления входной валидации, отзыва сессий и ошибок LB должны устранить конкретные регрессии, сохранив подтверждённые 202, единственность эффекта и монотонную публикацию версий pipeline. Проверяем корректность, а не прирост RPS.
|
||||
|
||||
На исходном f88e9ba с перенесёнными тестами получены 29 ожидаемых FAIL / 24 PASS (baseline-regressions.txt). PNG дошёл до попытки storage, вместо раннего 415; Basic/NUL не отклонялись как требуется. После переноса: 303 целевых unit PASS. `baseline.txt` — отдельная неуспешная попытка до появления файлов тестов, 0 запущенных тестов; результат не использован как проверка.
|
||||
|
||||
`make check validate lint`, `make student-test`: 819 PASS, 1 skip (RLIMIT_AS только Linux), 19 stack deselected. Это предкоммитные проверки рабочего diff, впоследствии зафиксированного в runtime SHA. Изменений runtime после него нет; финальные specs/evidence коммитятся отдельно. Context7 для SQLAlchemy 2.0.45 / FOR KEY SHARE использован при подготовке design.
|
||||
|
||||
Собственный Compose project `mtusi2026lab5`, API 127.0.0.1:18085, stats 25085, UI broker 25086; volumes сохранены между повторами. API_IMAGE=mtusi-messenger:lab5-forward. Конфигурация — compose.yaml с fault override infra/compose.faults.yaml. Параллельных нагрузок этого этапа нет; чужие контейнеры не останавливались. Host Darwin arm64 / 16 CPU; Docker 28.3.2 / 16 CPU / 8217190400 bytes RAM. NO_PROXY включает loopback. conditions-*.json содержит моментальные срезы: других проектов в них нет. Это не непрерывный мониторинг всей нагрузки хоста.
|
||||
|
||||
Команды, UTC, SHA, exit code и сырые результаты сохранены в одноимённых txt/json:
|
||||
|
||||
| Критерий | Команда | Наблюдение | Доказательство |
|
||||
| --- | --- | --- | --- |
|
||||
| Минимум lab1–4 / async upload | make test | PASS | smoke.txt, final-smoke.txt |
|
||||
| Сохранность после рестарта | make test-persistence ACTION_SCRIPT=scripts/restart.sh | PASS; действующая сессия и исходник сохранены | persistence.txt, persistence-containers.txt |
|
||||
| Отказ API | make test-failover ACTION_SCRIPT=scripts/stop-one.sh; make restore | 131 запись, 0 ошибок; api-2 Exited, затем восстановлен | failover.txt, failover-containers.txt, restore.txt |
|
||||
| Basic/NUL/logout через обе реплики | python3 student-tests/tools/forward_network.py | 401/400/404 по контракту; исправленный повтор ключа без дубля; logout 204→401 | network-regressions.txt |
|
||||
| Ранний отказ битого PNG и границы upload | pytest -m stack -s -q student-tests/stack/test_attachment_faults.py::test_user_errors_never_become_500 | IDAT/IHDR 415; 10 MiB принимается; строки только для 202; 123 HTTP в журнале, 0 5xx | upload-negative.txt |
|
||||
| Кэш недоступен | pytest -m stack -s -q student-tests/stack/test_faults.py::test_valkey_stopped_is_bypassed_but_logout_waits | 200 через БД, неизвестный 401, logout 503; после восстановления 204 и 401 | cache-outage.txt |
|
||||
| Гонки заполнения/потеря tombstone/SQL COMMIT | make student-test, api/test_cache.py + unit/test_session_cache.py | PASS, реальный одноразовый PostgreSQL/Valkey и управляемые гонки | student-test.txt, unit-regressions.txt |
|
||||
| 502/503/504 с кавычкой, backslash, tab и длиной 200 | fixture hlpipe-lab5-forward-errors, 3 × probe | 12 валидных JSON; тело и header совпадают; fixture остановлен | haproxy-errors.txt |
|
||||
| Уровни 3/4 | python3 scripts/pipeline_suite.py --level 4 --output evidence/forward-final-2026-11-06/level4.json | 17 сценариев, 8 инвариантов PASS; 33 IDs, 28 ready, 5 ожидаемых failed, 116 S3-объектов | level4-command.txt, level4.json |
|
||||
| Лимиты Linux worker | worker_limits внутри level4 | 40 Мп, 0.5 s / 200 MiB → контролируемый failed, worker жив; штатный peak 423 MiB < 1024 MiB | level4.json |
|
||||
| Трек 2 | make track2 TRACK2_OUTPUT=evidence/forward-final-2026-11-06/track-runN.json, N=1,2,3 последовательно | Все 13 сценариев и 8 инвариантов в каждом повторе PASS | track-run1/2/3.txt и .json |
|
||||
|
||||
## Результаты трека
|
||||
|
||||
В каждом повторе smoke_pipeline служит контролем без fault. Далее suite автоматически внедряет дубли, reorder attempts/versions, crash до side effect, после S3, после COMMIT до ack, разрыв outbox publish/confirm, SIGKILL worker и устаревшую job после v2. JSON содержит фактические остановленные контейнеры, принятые ID, версии, хеши и SQL/S3-инварианты.
|
||||
|
||||
| Повтор | Сценарии PASS | Инварианты PASS | Уникальные 202 | S3-объекты своей выборки | UTC-интервал, s | Монотонное elapsed, s |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| 1 | 13 | 8 | 13 | 58 | 181.175 | 181.089 |
|
||||
| 2 | 13 | 8 | 13 | 58 | 1161.195 | 186.458 |
|
||||
| 3 | 13 | 8 | 13 | 58 | 571.513 | 180.259 |
|
||||
|
||||
Итог: 39 разных принятых вложений, 174 S3-объекта; 39 сценариев и 24 проверки инвариантов PASS. Ни потери 202, ни повторного набора вариантов, ни отката ready/published_version не обнаружено. Старый результат не перезаписывает новый.
|
||||
|
||||
Сравнение с сохранённой предыдущей квалификацией runtime 9ba3076fa8ba707de932e053fc22f455d83b3210: те же 3 функциональных повтора, 39 сценариев, 24 инварианта, 39 вложений и 174 объекта PASS. Сравнение показывает сохранение инвариантов после forward, а не ускорение. Старое evidence сохраняет свой SHA. Входные дефекты на f88 воспроизведены отдельно и устранены.
|
||||
|
||||
Доставка остаётся at-least-once: подтверждение публикации и manual ack не образуют общей транзакции с PostgreSQL. Повтор той же job нормален после окна сбоя; уникальность versioned effects, lease/fencing и монотонная SQL-публикация ограничивают побочные эффекты. Это не exactly-once доставка.
|
||||
|
||||
## Ограничения для итогового REPORT
|
||||
|
||||
- У run2/3 расходятся UTC и монотонное elapsed (clock-observation.json). Причина не установлена. Длительности сохранены как сырые наблюдения, но исключены из performance/SLO и заявлений о разбросе. Трек 2 README не требует throughput/p95; все функциональные проверки и фактические fault-injection завершились. Повторять пригодные функциональные серии оснований нет.
|
||||
- Моментальные срезы Docker не доказывают отсутствие всей фоновой нагрузки хоста. Новых утверждений о RPS или сравнительной производительности нет; финальную release-нагрузку проводит назначенная фаза.
|
||||
- no_orphans ограничен IDs данного прогона. Исторические failed jobs и DLQ сохранены; в конце level4 DLQ 15 сообщений, включая ожидаемый malformed message, а не глобальный ноль.
|
||||
- Три прежних minor не изменились: ложный FAIL порядка secrets в scripts/limits.py; legacy scripts/reconcile_track.py для синхронной ЛР4; отсутствие отдельного retry failed upgrade v2 при ready v1. Подробности и происхождение — findings.json. Команде limits.py PASS не присвоен, она в этой фазе не запускалась.
|
||||
- REPORT/AGENTS и нормативные файлы не менялись; окончательный отчёт и публикация принадлежат следующим фазам.
|
||||
|
||||
## Завершение стенда
|
||||
|
||||
Финальный smoke PASS. `make down` завершён без `-v`; основной project не содержит контейнеров, временный fixture также остановлен. Сохранены mtusi2026lab5_broker-data, mtusi2026lab5_pgdata, mtusi2026lab5_s3data, mtusi2026lab5_valkeydata (retained-volumes.txt).
|
||||
@@ -0,0 +1,7 @@
|
||||
date: 2026-11-06T20:15:43Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {}
|
||||
$ openspec archive forward-lab4-final-review-fixes --yes --skip-specs
|
||||
Task status: ✓ Complete
|
||||
Skipping spec updates (--skip-specs flag provided).
|
||||
Change 'forward-lab4-final-review-fixes' archived as '2026-11-06-forward-lab4-final-review-fixes'.
|
||||
exit_code: 0 elapsed_seconds: 0.938
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
date: 2026-11-06T19:29:52Z commit: f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071
|
||||
environment: {}
|
||||
$ .venv/bin/pytest -q student-tests/unit/test_png_upload.py student-tests/unit/test_authentication.py student-tests/unit/test_nul_inputs.py
|
||||
ERROR: file or directory not found: student-tests/unit/test_png_upload.py
|
||||
|
||||
|
||||
no tests ran in 0.00s
|
||||
exit_code: 4 elapsed_seconds: 1.080
|
||||
@@ -0,0 +1,10 @@
|
||||
date: 2026-11-06T19:41:00Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ .venv/bin/pytest -m stack -s -q student-tests/stack/test_faults.py::test_valkey_stopped_is_bypassed_but_logout_waits
|
||||
valkey остановлен, действующий токен: 200 за 0.009 с
|
||||
valkey остановлен, неизвестный токен: 401 за 0.005 с
|
||||
valkey остановлен: ready 200, вход 201, выход 503
|
||||
valkey снова запущен: повторный выход 204
|
||||
.
|
||||
1 passed in 3.99s
|
||||
exit_code: 0 elapsed_seconds: 4.854
|
||||
@@ -0,0 +1,14 @@
|
||||
date: 2026-11-06T19:30:49Z commit: f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071
|
||||
environment: {"NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ make check validate lint
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
.venv/bin/ruff check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
All checks passed!
|
||||
.venv/bin/ruff format --check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
193 files already formatted
|
||||
.venv/bin/ty check src student-tests alembic
|
||||
All checks passed!
|
||||
exit_code: 0 elapsed_seconds: 0.637
|
||||
@@ -0,0 +1,14 @@
|
||||
date: 2026-11-06T20:15:45Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {}
|
||||
$ make check validate lint
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
.venv/bin/ruff check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
All checks passed!
|
||||
.venv/bin/ruff format --check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
194 files already formatted
|
||||
.venv/bin/ty check src student-tests alembic
|
||||
All checks passed!
|
||||
exit_code: 0 elapsed_seconds: 0.822
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"observed_at": "2026-11-06T20:15:05.166068+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"runs": [
|
||||
{
|
||||
"file": "track-run1.json",
|
||||
"utc_interval_seconds": 181.175,
|
||||
"capture_monotonic_seconds": 181.089,
|
||||
"time_comparable": true
|
||||
},
|
||||
{
|
||||
"file": "track-run2.json",
|
||||
"utc_interval_seconds": 1161.195,
|
||||
"capture_monotonic_seconds": 186.458,
|
||||
"time_comparable": false
|
||||
},
|
||||
{
|
||||
"file": "track-run3.json",
|
||||
"utc_interval_seconds": 571.513,
|
||||
"capture_monotonic_seconds": 180.259,
|
||||
"time_comparable": false
|
||||
}
|
||||
],
|
||||
"conclusion": "UTC and host monotonic elapsed disagree in run2/3; cause not determined. All functional assertions passed. Durations excluded from performance comparison, SLO and spread claims. README track2 has no throughput/latency target. Adjacent Docker snapshots show no other projects; no functional rerun justified."
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"at": "2026-11-06T19:33:37.768460+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
2.90673828125,
|
||||
2.244140625,
|
||||
2.03662109375
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"at": "2026-11-06T19:37:39.764784+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
1.72900390625,
|
||||
2.11865234375,
|
||||
2.03466796875
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [
|
||||
{
|
||||
"Name": "mtusi2026lab5-worker-1",
|
||||
"CPUPerc": "0.15%",
|
||||
"MemUsage": "123.9MiB / 1GiB",
|
||||
"PIDs": "5"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-relay-1",
|
||||
"CPUPerc": "1.23%",
|
||||
"MemUsage": "107MiB / 192MiB",
|
||||
"PIDs": "4"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-1",
|
||||
"CPUPerc": "8.17%",
|
||||
"MemUsage": "231.6MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-2",
|
||||
"CPUPerc": "8.01%",
|
||||
"MemUsage": "225MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-broker-1",
|
||||
"CPUPerc": "0.19%",
|
||||
"MemUsage": "95.59MiB / 512MiB",
|
||||
"PIDs": "53"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-postgres-1",
|
||||
"CPUPerc": "2.44%",
|
||||
"MemUsage": "59.16MiB / 1GiB",
|
||||
"PIDs": "14"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-lb-1",
|
||||
"CPUPerc": "1.05%",
|
||||
"MemUsage": "18.64MiB / 128MiB",
|
||||
"PIDs": "17"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-s3-1",
|
||||
"CPUPerc": "26.24%",
|
||||
"MemUsage": "171.1MiB / 512MiB",
|
||||
"PIDs": "16"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-valkey-1",
|
||||
"CPUPerc": "1.26%",
|
||||
"MemUsage": "13.09MiB / 128MiB",
|
||||
"PIDs": "7"
|
||||
}
|
||||
],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"at": "2026-11-06T19:35:55.131308+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
2.28515625,
|
||||
2.18994140625,
|
||||
2.04150390625
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-1",
|
||||
"CPUPerc": "1.18%",
|
||||
"MemUsage": "219.9MiB / 512MiB",
|
||||
"PIDs": "12"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-worker-1",
|
||||
"CPUPerc": "0.24%",
|
||||
"MemUsage": "216.1MiB / 1GiB",
|
||||
"PIDs": "8"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-2",
|
||||
"CPUPerc": "0.37%",
|
||||
"MemUsage": "200.9MiB / 512MiB",
|
||||
"PIDs": "11"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-relay-1",
|
||||
"CPUPerc": "0.91%",
|
||||
"MemUsage": "106.2MiB / 192MiB",
|
||||
"PIDs": "4"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-broker-1",
|
||||
"CPUPerc": "16.07%",
|
||||
"MemUsage": "154.6MiB / 512MiB",
|
||||
"PIDs": "103"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-postgres-1",
|
||||
"CPUPerc": "0.96%",
|
||||
"MemUsage": "50.39MiB / 1GiB",
|
||||
"PIDs": "14"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-lb-1",
|
||||
"CPUPerc": "0.13%",
|
||||
"MemUsage": "18.16MiB / 128MiB",
|
||||
"PIDs": "17"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-s3-1",
|
||||
"CPUPerc": "1.17%",
|
||||
"MemUsage": "111.8MiB / 512MiB",
|
||||
"PIDs": "11"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-valkey-1",
|
||||
"CPUPerc": "0.19%",
|
||||
"MemUsage": "13.07MiB / 128MiB",
|
||||
"PIDs": "7"
|
||||
}
|
||||
],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"at": "2026-11-06T20:13:44.524983+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
3.6494140625,
|
||||
3.861328125,
|
||||
3.04296875
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"at": "2026-11-06T19:44:11.713768+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
3.2333984375,
|
||||
2.62939453125,
|
||||
2.30126953125
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [
|
||||
{
|
||||
"Name": "mtusi2026lab5-relay-1",
|
||||
"CPUPerc": "0.18%",
|
||||
"MemUsage": "105.9MiB / 192MiB",
|
||||
"PIDs": "4"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-worker-1",
|
||||
"CPUPerc": "0.14%",
|
||||
"MemUsage": "95.77MiB / 1GiB",
|
||||
"PIDs": "3"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-1",
|
||||
"CPUPerc": "14.11%",
|
||||
"MemUsage": "246.7MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-2",
|
||||
"CPUPerc": "14.21%",
|
||||
"MemUsage": "242.7MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-broker-1",
|
||||
"CPUPerc": "0.61%",
|
||||
"MemUsage": "104.9MiB / 512MiB",
|
||||
"PIDs": "53"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-postgres-1",
|
||||
"CPUPerc": "1.79%",
|
||||
"MemUsage": "58.75MiB / 1GiB",
|
||||
"PIDs": "15"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-lb-1",
|
||||
"CPUPerc": "1.10%",
|
||||
"MemUsage": "25.59MiB / 128MiB",
|
||||
"PIDs": "17"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-s3-1",
|
||||
"CPUPerc": "0.08%",
|
||||
"MemUsage": "180.5MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-valkey-1",
|
||||
"CPUPerc": "0.18%",
|
||||
"MemUsage": "13.31MiB / 128MiB",
|
||||
"PIDs": "7"
|
||||
}
|
||||
],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"at": "2026-11-06T20:03:36.100013+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
3.52001953125,
|
||||
2.96923828125,
|
||||
2.5068359375
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [
|
||||
{
|
||||
"Name": "mtusi2026lab5-worker-1",
|
||||
"CPUPerc": "0.19%",
|
||||
"MemUsage": "95.77MiB / 1GiB",
|
||||
"PIDs": "3"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-relay-1",
|
||||
"CPUPerc": "0.52%",
|
||||
"MemUsage": "105.9MiB / 192MiB",
|
||||
"PIDs": "4"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-1",
|
||||
"CPUPerc": "1.13%",
|
||||
"MemUsage": "247.5MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-2",
|
||||
"CPUPerc": "0.74%",
|
||||
"MemUsage": "243.2MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-broker-1",
|
||||
"CPUPerc": "0.25%",
|
||||
"MemUsage": "104.8MiB / 512MiB",
|
||||
"PIDs": "53"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-postgres-1",
|
||||
"CPUPerc": "0.99%",
|
||||
"MemUsage": "55.21MiB / 1GiB",
|
||||
"PIDs": "15"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-lb-1",
|
||||
"CPUPerc": "0.97%",
|
||||
"MemUsage": "25.59MiB / 128MiB",
|
||||
"PIDs": "17"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-s3-1",
|
||||
"CPUPerc": "0.03%",
|
||||
"MemUsage": "175.3MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-valkey-1",
|
||||
"CPUPerc": "0.20%",
|
||||
"MemUsage": "13.46MiB / 128MiB",
|
||||
"PIDs": "7"
|
||||
}
|
||||
],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"at": "2026-11-06T20:13:10.819292+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
4.41796875,
|
||||
4.0205078125,
|
||||
3.06396484375
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [
|
||||
{
|
||||
"Name": "mtusi2026lab5-worker-1",
|
||||
"CPUPerc": "0.27%",
|
||||
"MemUsage": "95.73MiB / 1GiB",
|
||||
"PIDs": "3"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-relay-1",
|
||||
"CPUPerc": "0.53%",
|
||||
"MemUsage": "106.2MiB / 192MiB",
|
||||
"PIDs": "4"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-1",
|
||||
"CPUPerc": "0.84%",
|
||||
"MemUsage": "247.4MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-2",
|
||||
"CPUPerc": "1.21%",
|
||||
"MemUsage": "243MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-broker-1",
|
||||
"CPUPerc": "0.22%",
|
||||
"MemUsage": "105MiB / 512MiB",
|
||||
"PIDs": "53"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-postgres-1",
|
||||
"CPUPerc": "0.98%",
|
||||
"MemUsage": "60.75MiB / 1GiB",
|
||||
"PIDs": "15"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-lb-1",
|
||||
"CPUPerc": "0.17%",
|
||||
"MemUsage": "25.93MiB / 128MiB",
|
||||
"PIDs": "17"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-s3-1",
|
||||
"CPUPerc": "1.36%",
|
||||
"MemUsage": "180.3MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-valkey-1",
|
||||
"CPUPerc": "0.30%",
|
||||
"MemUsage": "13.22MiB / 128MiB",
|
||||
"PIDs": "7"
|
||||
}
|
||||
],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"at": "2026-11-06T19:41:07.614200+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"platform": "Darwin",
|
||||
"architecture": "arm64",
|
||||
"host_cpus": 16,
|
||||
"host_load": [
|
||||
3.16357421875,
|
||||
2.60009765625,
|
||||
2.23828125
|
||||
],
|
||||
"docker": "16 CPUs; 8217190400 bytes; 28.3.2",
|
||||
"own_project": "mtusi2026lab5",
|
||||
"own": [
|
||||
{
|
||||
"Name": "mtusi2026lab5-worker-1",
|
||||
"CPUPerc": "0.24%",
|
||||
"MemUsage": "95.74MiB / 1GiB",
|
||||
"PIDs": "3"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-relay-1",
|
||||
"CPUPerc": "0.49%",
|
||||
"MemUsage": "106MiB / 192MiB",
|
||||
"PIDs": "4"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-1",
|
||||
"CPUPerc": "0.58%",
|
||||
"MemUsage": "241MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-api-2",
|
||||
"CPUPerc": "0.82%",
|
||||
"MemUsage": "239.4MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-broker-1",
|
||||
"CPUPerc": "0.19%",
|
||||
"MemUsage": "96.05MiB / 512MiB",
|
||||
"PIDs": "53"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-postgres-1",
|
||||
"CPUPerc": "0.26%",
|
||||
"MemUsage": "53.82MiB / 1GiB",
|
||||
"PIDs": "15"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-lb-1",
|
||||
"CPUPerc": "0.15%",
|
||||
"MemUsage": "25.61MiB / 128MiB",
|
||||
"PIDs": "17"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-s3-1",
|
||||
"CPUPerc": "0.79%",
|
||||
"MemUsage": "164.7MiB / 512MiB",
|
||||
"PIDs": "13"
|
||||
},
|
||||
{
|
||||
"Name": "mtusi2026lab5-valkey-1",
|
||||
"CPUPerc": "1.42%",
|
||||
"MemUsage": "13.04MiB / 128MiB",
|
||||
"PIDs": "7"
|
||||
}
|
||||
],
|
||||
"other_projects": {},
|
||||
"sampling": "Shared Docker snapshot; no throughput claim"
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
date: 2026-11-06T20:13:40Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make down
|
||||
docker compose --profile bench --profile tools --profile reconcile down
|
||||
Container mtusi2026lab5-relay-1 Stopping
|
||||
Container mtusi2026lab5-lb-1 Stopping
|
||||
Container mtusi2026lab5-api-2 Stopping
|
||||
Container mtusi2026lab5-worker-1 Stopping
|
||||
Container mtusi2026lab5-api-1 Stopping
|
||||
Container mtusi2026lab5-lb-1 Stopped
|
||||
Container mtusi2026lab5-lb-1 Removing
|
||||
Container mtusi2026lab5-worker-1 Stopped
|
||||
Container mtusi2026lab5-worker-1 Removing
|
||||
Container mtusi2026lab5-lb-1 Removed
|
||||
Container mtusi2026lab5-relay-1 Stopped
|
||||
Container mtusi2026lab5-relay-1 Removing
|
||||
Container mtusi2026lab5-worker-1 Removed
|
||||
Container mtusi2026lab5-relay-1 Removed
|
||||
Container mtusi2026lab5-broker-1 Stopping
|
||||
Container mtusi2026lab5-broker-1 Stopped
|
||||
Container mtusi2026lab5-broker-1 Removing
|
||||
Container mtusi2026lab5-broker-1 Removed
|
||||
Container mtusi2026lab5-api-1 Stopped
|
||||
Container mtusi2026lab5-api-1 Removing
|
||||
Container mtusi2026lab5-api-2 Stopped
|
||||
Container mtusi2026lab5-api-2 Removing
|
||||
Container mtusi2026lab5-api-1 Removed
|
||||
Container mtusi2026lab5-api-2 Removed
|
||||
Container mtusi2026lab5-migrate-1 Stopping
|
||||
Container mtusi2026lab5-s3-init-1 Stopping
|
||||
Container mtusi2026lab5-valkey-1 Stopping
|
||||
Container mtusi2026lab5-migrate-1 Stopped
|
||||
Container mtusi2026lab5-migrate-1 Removing
|
||||
Container mtusi2026lab5-s3-init-1 Stopped
|
||||
Container mtusi2026lab5-s3-init-1 Removing
|
||||
Container mtusi2026lab5-s3-init-1 Removed
|
||||
Container mtusi2026lab5-s3-1 Stopping
|
||||
Container mtusi2026lab5-migrate-1 Removed
|
||||
Container mtusi2026lab5-postgres-1 Stopping
|
||||
Container mtusi2026lab5-valkey-1 Stopped
|
||||
Container mtusi2026lab5-valkey-1 Removing
|
||||
Container mtusi2026lab5-s3-1 Stopped
|
||||
Container mtusi2026lab5-s3-1 Removing
|
||||
Container mtusi2026lab5-valkey-1 Removed
|
||||
Container mtusi2026lab5-s3-1 Removed
|
||||
Container mtusi2026lab5-postgres-1 Stopped
|
||||
Container mtusi2026lab5-postgres-1 Removing
|
||||
Container mtusi2026lab5-postgres-1 Removed
|
||||
Network mtusi2026lab5_backend Removing
|
||||
Network mtusi2026lab5_edge Removing
|
||||
Network mtusi2026lab5_backend Removed
|
||||
Network mtusi2026lab5_edge Removed
|
||||
exit_code: 0 elapsed_seconds: 3.359
|
||||
@@ -0,0 +1,16 @@
|
||||
date: 2026-11-06T19:34:42Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ docker compose ps -a
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
mtusi2026lab5-api-1 mtusi-messenger:lab5-forward "python -m gunicorn …" api 54 seconds ago Up 19 seconds (healthy)
|
||||
mtusi2026lab5-api-2 mtusi-messenger:lab5-forward "python -m gunicorn …" api 54 seconds ago Exited (0) 12 seconds ago
|
||||
mtusi2026lab5-broker-1 rabbitmq:4.1.8-management-alpine@sha256:54ef5ff505352c1beef05a97ee9bd6ab95b3559a76629ba0119b1d63d8d6e4b2 "docker-entrypoint.s…" broker 55 seconds ago Up 24 seconds (healthy) 127.0.0.1:25086->15672/tcp
|
||||
mtusi2026lab5-lb-1 haproxy:3.2.26-alpine@sha256:5893840576071e6217cd52ebdcc14f454c6f7a631056fa6f4e0f40d3cac4215b "docker-entrypoint.s…" lb 55 seconds ago Up 24 seconds (healthy) 127.0.0.1:18085->8080/tcp, 127.0.0.1:25085->8404/tcp
|
||||
mtusi2026lab5-migrate-1 mtusi-messenger:lab5-forward "alembic upgrade head" migrate 54 seconds ago Exited (0) 22 seconds ago
|
||||
mtusi2026lab5-postgres-1 postgres:17.11-alpine@sha256:266d3c257594e195b309ae9d1805e54c788f1d7b375f56bf6c367aac6c917e7b "docker-entrypoint.s…" postgres 55 seconds ago Up 25 seconds (healthy)
|
||||
mtusi2026lab5-relay-1 mtusi-messenger:lab5-forward "python -m messenger…" relay 54 seconds ago Up 19 seconds (healthy)
|
||||
mtusi2026lab5-s3-1 rustfs/rustfs:1.0.4@sha256:ed9210d6411d77ffceb70d94b964a3cb7d225983368bc25bebe01e995293dcc2 "/entrypoint.sh rust…" s3 55 seconds ago Up 25 seconds (healthy)
|
||||
mtusi2026lab5-s3-init-1 rustfs/rc:v0.1.36@sha256:ab024bfebee49a750ce886b4c70963ccd9ddaa03f491704a90710641d7a26699 "/bin/sh /s3/init.sh" s3-init 54 seconds ago Exited (0) 20 seconds ago
|
||||
mtusi2026lab5-valkey-1 valkey/valkey:8.1.11-alpine@sha256:2602ace2be6569bc2bbb06f873776516ab9089821525be34f4305c67eb9db02a "tini -- docker-entr…" valkey 55 seconds ago Up 25 seconds (healthy)
|
||||
mtusi2026lab5-worker-1 mtusi-messenger:lab5-forward "python -m messenger…" worker 54 seconds ago Up 19 seconds (healthy)
|
||||
exit_code: 0 elapsed_seconds: 0.124
|
||||
@@ -0,0 +1,8 @@
|
||||
date: 2026-11-06T19:34:25Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://127.0.0.1:18085"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 131, "failed_attempts": 0, "first_recovery_seconds": 2.791}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit_code: 0 elapsed_seconds: 16.815
|
||||
@@ -0,0 +1,16 @@
|
||||
date: 2026-11-06T20:13:40Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ docker compose ps -a
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
mtusi2026lab5-api-1 mtusi-messenger:lab5-forward "python -m gunicorn …" api 39 minutes ago Up 37 minutes (healthy)
|
||||
mtusi2026lab5-api-2 mtusi-messenger:lab5-forward "python -m gunicorn …" api 39 minutes ago Up 37 minutes (healthy)
|
||||
mtusi2026lab5-broker-1 rabbitmq:4.1.8-management-alpine@sha256:54ef5ff505352c1beef05a97ee9bd6ab95b3559a76629ba0119b1d63d8d6e4b2 "docker-entrypoint.s…" broker 39 minutes ago Up 37 minutes (healthy) 127.0.0.1:25086->15672/tcp
|
||||
mtusi2026lab5-lb-1 haproxy:3.2.26-alpine@sha256:5893840576071e6217cd52ebdcc14f454c6f7a631056fa6f4e0f40d3cac4215b "docker-entrypoint.s…" lb 39 minutes ago Up 39 minutes (healthy) 127.0.0.1:18085->8080/tcp, 127.0.0.1:25085->8404/tcp
|
||||
mtusi2026lab5-migrate-1 mtusi-messenger:lab5-forward "alembic upgrade head" migrate 39 minutes ago Exited (0) 39 minutes ago
|
||||
mtusi2026lab5-postgres-1 postgres:17.11-alpine@sha256:266d3c257594e195b309ae9d1805e54c788f1d7b375f56bf6c367aac6c917e7b "docker-entrypoint.s…" postgres 39 minutes ago Up 39 minutes (healthy)
|
||||
mtusi2026lab5-relay-1 mtusi-messenger:lab5-forward "python -m messenger…" relay 35 seconds ago Up 34 seconds (healthy)
|
||||
mtusi2026lab5-s3-1 rustfs/rustfs:1.0.4@sha256:ed9210d6411d77ffceb70d94b964a3cb7d225983368bc25bebe01e995293dcc2 "/entrypoint.sh rust…" s3 39 minutes ago Up 37 minutes (healthy)
|
||||
mtusi2026lab5-s3-init-1 rustfs/rc:v0.1.36@sha256:ab024bfebee49a750ce886b4c70963ccd9ddaa03f491704a90710641d7a26699 "/bin/sh /s3/init.sh" s3-init 39 minutes ago Exited (0) 39 minutes ago
|
||||
mtusi2026lab5-valkey-1 valkey/valkey:8.1.11-alpine@sha256:2602ace2be6569bc2bbb06f873776516ab9089821525be34f4305c67eb9db02a "tini -- docker-entr…" valkey 39 minutes ago Up 32 minutes (healthy)
|
||||
mtusi2026lab5-worker-1 mtusi-messenger:lab5-forward "python -m messenger…" worker 35 seconds ago Up 34 seconds (healthy)
|
||||
exit_code: 0 elapsed_seconds: 0.108
|
||||
@@ -0,0 +1,6 @@
|
||||
date: 2026-11-06T20:13:38Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make test
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:18085"
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
exit_code: 0 elapsed_seconds: 1.289
|
||||
@@ -0,0 +1,25 @@
|
||||
[
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "scripts/limits.py:14",
|
||||
"problem": "S3_CLIENT_SECRETS не отсортирован, declared() сравнивает с sorted(secrets). Два ложных несовпадения для s3-cli/s3-init при равных множествах имён; limits.txt exit_code=1. Реальные CPU/RAM и порты показаны в том же файле.",
|
||||
"provenance": "evidence/sqlalchemy-2026-11-06/track2/findings.json; unchanged by source range"
|
||||
},
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "scripts/reconcile_track.py",
|
||||
"problem": "Перенесённый демонстратор ЛР4 ожидает upload 201 и legacy prefix; не пригоден для измерений ЛР5 (унаследовано из forward-lab4-sqlalchemy-foundation/findings.json). В квалификации pipeline не используется.",
|
||||
"provenance": "evidence/sqlalchemy-2026-11-06/track2/findings.json; unchanged by source range"
|
||||
},
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "src/messenger/attachments/application/pipeline.py:333",
|
||||
"problem": "Если v2 завершилась failed при уже опубликованной ready v1, reprocess существующей v2 возвращает noop, а replay ориентирован на failed-вложение и для ready также noop. Старый результат доступен и не теряется; отдельное восстановление failed upgrade пока не реализовано. Основание: test_failed_new_version_keeps_ready_original и ветви ReplayAttachmentHandler/_schedule.",
|
||||
"provenance": "evidence/sqlalchemy-2026-11-06/track2/findings.json; unchanged by source range"
|
||||
},
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "evidence/forward-final-2026-11-06/clock-observation.json",
|
||||
"problem": "В run2/3 UTC-интервал расходится с монотонным elapsed; причина не установлена. Функциональные сценарии и инварианты PASS, времена исключены из выводов о производительности и разбросе. Трек 2 не задаёт нормативных throughput/latency метрик."
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"source_final": "lab4-4ed889c1e4008e3f6040ae2534bef99262d3b8ce",
|
||||
"runtime_and_test_paths": [
|
||||
{
|
||||
"file": "infra/haproxy/haproxy.cfg",
|
||||
"source_sha256": "50a0f551f0d77462aeb25354ba72fcdc49ef2503b92054b11888f680e6245e04",
|
||||
"target_sha256": "50a0f551f0d77462aeb25354ba72fcdc49ef2503b92054b11888f680e6245e04",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/attachments/infrastructure/images.py",
|
||||
"source_sha256": "cef5f44a9c5bea5de5fca43ee12be7e53c5137bf24646100d795cd8ef024ff6d",
|
||||
"target_sha256": "4fa19abf1a98f38f6f4c3b8c390a7e62beaef9aba1a9899ee92e29e42d1e5133",
|
||||
"equal": false
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/attachments/infrastructure/png.py",
|
||||
"source_sha256": "50491204d8a3667371962f43830a2b53a8b478b5941238a8db211a8a77cc57ff",
|
||||
"target_sha256": "50491204d8a3667371962f43830a2b53a8b478b5941238a8db211a8a77cc57ff",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/identity/application/handlers.py",
|
||||
"source_sha256": "7ef32d82c687045613a12ff4d3a66376bf942ac590697f9390894b01fbc3b8f2",
|
||||
"target_sha256": "7ef32d82c687045613a12ff4d3a66376bf942ac590697f9390894b01fbc3b8f2",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/identity/domain/values.py",
|
||||
"source_sha256": "407688bf7516c617365e021ee61abffb51e462c17640062a66a636cc25c96534",
|
||||
"target_sha256": "407688bf7516c617365e021ee61abffb51e462c17640062a66a636cc25c96534",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/identity/entrypoints/authentication.py",
|
||||
"source_sha256": "ceaf2bf6a639fd8004de101372fca37b32f13ee6cbc6e0c159e871cc54110c6a",
|
||||
"target_sha256": "ceaf2bf6a639fd8004de101372fca37b32f13ee6cbc6e0c159e871cc54110c6a",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/identity/infrastructure/postgres.py",
|
||||
"source_sha256": "a3c4824c5eeff98e3e5d0769d5c92733ea45d1bcd5735b61cbb21b2f41975bd4",
|
||||
"target_sha256": "a3c4824c5eeff98e3e5d0769d5c92733ea45d1bcd5735b61cbb21b2f41975bd4",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/identity/infrastructure/valkey.py",
|
||||
"source_sha256": "d7eb27d20c0b8b5c74214ea863fd9f17c64b171e1ebecf9930cd9c458a7069fa",
|
||||
"target_sha256": "d7eb27d20c0b8b5c74214ea863fd9f17c64b171e1ebecf9930cd9c458a7069fa",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "src/messenger/messaging/domain/values.py",
|
||||
"source_sha256": "eebba913911ef4c533f1d9715445e1471ad538c3631548ad36c44f4c092e9e5f",
|
||||
"target_sha256": "eebba913911ef4c533f1d9715445e1471ad538c3631548ad36c44f4c092e9e5f",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/api/test_attachments.py",
|
||||
"source_sha256": "aa85859184f532c4112aaf39c21d4e2c8f2ca60e3dee701fb37a24aa4296c60b",
|
||||
"target_sha256": "e3eacfad65d93951d40fbb1b2dbe4ddccbde98d9f00c92f82ce72d2fbbc8f88b",
|
||||
"equal": false
|
||||
},
|
||||
{
|
||||
"file": "student-tests/api/test_cache.py",
|
||||
"source_sha256": "ed62c0084dab3087a9d221fb52e2d67f3bc2c9d12c1bb0417627e6bca105a299",
|
||||
"target_sha256": "ed62c0084dab3087a9d221fb52e2d67f3bc2c9d12c1bb0417627e6bca105a299",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/api/test_nul_validation.py",
|
||||
"source_sha256": "f6dbd33aad5463f183ccfb295caa7d5aabd4ced0fbdf65202ef22ed540cadec0",
|
||||
"target_sha256": "f6dbd33aad5463f183ccfb295caa7d5aabd4ced0fbdf65202ef22ed540cadec0",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/api/test_sessions.py",
|
||||
"source_sha256": "bf63df875358990a8c6437797f0c56212cd608bddebb0c8fa5454f694118b059",
|
||||
"target_sha256": "bf63df875358990a8c6437797f0c56212cd608bddebb0c8fa5454f694118b059",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/pictures.py",
|
||||
"source_sha256": "fd2fe8997eaaad05082c7617aa8ece7fca0712117484f3fa3e875f701e5736b9",
|
||||
"target_sha256": "fd2fe8997eaaad05082c7617aa8ece7fca0712117484f3fa3e875f701e5736b9",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/stack/test_attachment_faults.py",
|
||||
"source_sha256": "3b56532453e92a6c66b3946570d529fe712d106543d0882335b9d423c1bfdd14",
|
||||
"target_sha256": "3255caebb58c14bed5638f111eef3c55f35b3f34f9ea453f21f66d4c531d63cd",
|
||||
"equal": false
|
||||
},
|
||||
{
|
||||
"file": "student-tests/tools/forward_network.py",
|
||||
"source_sha256": "2af7c53bcf74100685d3f89fbcbfa5d28ee2e10b4dd144c763e67fc2350ddc21",
|
||||
"target_sha256": "19a80def7e5a1e79eca871ea264094f0c643e61d0cb1cfbfad67ab4196c516dd",
|
||||
"equal": false
|
||||
},
|
||||
{
|
||||
"file": "student-tests/tools/lb_errors/client.py",
|
||||
"source_sha256": "7759bf22bbf122b4e1f54548a0e8a55f2ac42e42d8f482c95db2dc107aca6379",
|
||||
"target_sha256": "7759bf22bbf122b4e1f54548a0e8a55f2ac42e42d8f482c95db2dc107aca6379",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/tools/lb_errors/compose.yaml",
|
||||
"source_sha256": "169c98e8a22cb37426824f6aee7b76a08e40b34cf9822caa7f1ecefe25e4f6b2",
|
||||
"target_sha256": "b3ba612546cf23bb202456b2935f621d8a9cad43a556f27cfd93807273c3a7e3",
|
||||
"equal": false
|
||||
},
|
||||
{
|
||||
"file": "student-tests/tools/lb_errors/server.py",
|
||||
"source_sha256": "ce779c03f48f1ce671e8c65cc7b8a81d8e765d687de78433e114e5e792dbeced",
|
||||
"target_sha256": "ce779c03f48f1ce671e8c65cc7b8a81d8e765d687de78433e114e5e792dbeced",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/unit/test_authentication.py",
|
||||
"source_sha256": "c03b4860cc3ad9cebf1589d0ac1adcde190f6a30f011357bdad219b1ca7cc1f0",
|
||||
"target_sha256": "c03b4860cc3ad9cebf1589d0ac1adcde190f6a30f011357bdad219b1ca7cc1f0",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/unit/test_haproxy_errors.py",
|
||||
"source_sha256": "d1b76a39608ddf9134b9f48a467c95983e4adf6556a52115c8299bdf3489dfcb",
|
||||
"target_sha256": "d1b76a39608ddf9134b9f48a467c95983e4adf6556a52115c8299bdf3489dfcb",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/unit/test_image_inspection.py",
|
||||
"source_sha256": "05e408957a46f4fbdd77b6d5401f0374f758cc8826d7b717f600c91582d40480",
|
||||
"target_sha256": "05e408957a46f4fbdd77b6d5401f0374f758cc8826d7b717f600c91582d40480",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/unit/test_nul_inputs.py",
|
||||
"source_sha256": "43f0088c95440fa90c43b40b5ad19db4ffa28bf1a198b385b104495d259bcb93",
|
||||
"target_sha256": "43f0088c95440fa90c43b40b5ad19db4ffa28bf1a198b385b104495d259bcb93",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/unit/test_png_upload.py",
|
||||
"source_sha256": "a185767a118d3a50358de0e27d125efd4a413c518bb25f4e029fbf45fb5b0aea",
|
||||
"target_sha256": "a185767a118d3a50358de0e27d125efd4a413c518bb25f4e029fbf45fb5b0aea",
|
||||
"equal": true
|
||||
},
|
||||
{
|
||||
"file": "student-tests/unit/test_session_cache.py",
|
||||
"source_sha256": "64be3f10ef6dba6c0258eef1a5cb8b73450da7eca95bdc4d28484e96db160ef0",
|
||||
"target_sha256": "64be3f10ef6dba6c0258eef1a5cb8b73450da7eca95bdc4d28484e96db160ef0",
|
||||
"equal": true
|
||||
}
|
||||
],
|
||||
"protected_unchanged": [
|
||||
"contracts",
|
||||
"tests",
|
||||
"README.md",
|
||||
"COURSE.md",
|
||||
"REPORT.md",
|
||||
"AGENTS.md",
|
||||
"src/messenger/attachments/application/pipeline.py",
|
||||
"src/messenger/attachments/infrastructure/postgres.py",
|
||||
"src/messenger/worker.py",
|
||||
"src/messenger/relay.py"
|
||||
],
|
||||
"source_snapshot_head": "4ed889c1e4008e3f6040ae2534bef99262d3b8ce"
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
date: 2026-11-06T19:34:55Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ sh -c 'set -e
|
||||
fixture() { docker compose -p hlpipe-lab5-forward-errors -f student-tests/tools/lb_errors/compose.yaml "$@"; }
|
||||
trap "fixture down" EXIT
|
||||
fixture up -d lb api
|
||||
fixture run --rm --no-deps probe 502
|
||||
fixture run --rm --no-deps probe 504
|
||||
fixture stop api
|
||||
fixture run --rm --no-deps probe 503
|
||||
fixture ps -a'
|
||||
Network hlpipe-lab5-forward-errors_default Creating
|
||||
Network hlpipe-lab5-forward-errors_default Created
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Creating
|
||||
Container hlpipe-lab5-forward-errors-api-1 Creating
|
||||
Container hlpipe-lab5-forward-errors-api-1 Created
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Created
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Starting
|
||||
Container hlpipe-lab5-forward-errors-api-1 Starting
|
||||
Container hlpipe-lab5-forward-errors-api-1 Started
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Started
|
||||
{"status": 502, "request_id": "a\"b", "json_valid": true, "echo_matches": true, "seconds": 0.002}
|
||||
{"status": 502, "request_id": "a\\b", "json_valid": true, "echo_matches": true, "seconds": 0.002}
|
||||
{"status": 502, "request_id": "a\tb", "json_valid": true, "echo_matches": true, "seconds": 0.002}
|
||||
{"status": 502, "request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "json_valid": true, "echo_matches": true, "seconds": 0.001}
|
||||
{"status": 504, "request_id": "a\"b", "json_valid": true, "echo_matches": true, "seconds": 10.005}
|
||||
{"status": 504, "request_id": "a\\b", "json_valid": true, "echo_matches": true, "seconds": 10.009}
|
||||
{"status": 504, "request_id": "a\tb", "json_valid": true, "echo_matches": true, "seconds": 10.015}
|
||||
{"status": 504, "request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "json_valid": true, "echo_matches": true, "seconds": 10.009}
|
||||
Container hlpipe-lab5-forward-errors-api-1 Stopping
|
||||
Container hlpipe-lab5-forward-errors-api-1 Stopped
|
||||
{"status": 503, "request_id": "a\"b", "json_valid": true, "echo_matches": true, "seconds": 0.004}
|
||||
{"status": 503, "request_id": "a\\b", "json_valid": true, "echo_matches": true, "seconds": 0.0}
|
||||
{"status": 503, "request_id": "a\tb", "json_valid": true, "echo_matches": true, "seconds": 0.0}
|
||||
{"status": 503, "request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "json_valid": true, "echo_matches": true, "seconds": 0.0}
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
hlpipe-lab5-forward-errors-api-1 mtusi-messenger:lab5-forward "python /fixture/ser…" api 49 seconds ago Exited (143) 5 seconds ago
|
||||
hlpipe-lab5-forward-errors-lb-1 haproxy:3.2.26-alpine@sha256:5893840576071e6217cd52ebdcc14f454c6f7a631056fa6f4e0f40d3cac4215b "docker-entrypoint.s…" lb 49 seconds ago Up 48 seconds
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Stopping
|
||||
Container hlpipe-lab5-forward-errors-api-1 Stopping
|
||||
Container hlpipe-lab5-forward-errors-api-1 Stopped
|
||||
Container hlpipe-lab5-forward-errors-api-1 Removing
|
||||
Container hlpipe-lab5-forward-errors-api-1 Removed
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Stopped
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Removing
|
||||
Container hlpipe-lab5-forward-errors-lb-1 Removed
|
||||
Network hlpipe-lab5-forward-errors_default Removing
|
||||
Network hlpipe-lab5-forward-errors_default Removed
|
||||
exit_code: 0 elapsed_seconds: 52.862
|
||||
@@ -0,0 +1,16 @@
|
||||
date: 2026-11-06T20:13:40Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ docker compose images
|
||||
CONTAINER REPOSITORY TAG PLATFORM IMAGE ID SIZE CREATED
|
||||
mtusi2026lab5-api-1 mtusi-messenger lab5-forward linux/arm64 44b21448c1e7 103MB 39 minutes ago
|
||||
mtusi2026lab5-api-2 mtusi-messenger lab5-forward linux/arm64 44b21448c1e7 103MB 39 minutes ago
|
||||
mtusi2026lab5-broker-1 rabbitmq <none> linux/arm64/v8 54ef5ff50535 86.3MB 9 days ago
|
||||
mtusi2026lab5-lb-1 haproxy <none> linux/arm64/v8 589384057607 18.2MB 9 days ago
|
||||
mtusi2026lab5-migrate-1 mtusi-messenger lab5-forward linux/arm64 44b21448c1e7 103MB 39 minutes ago
|
||||
mtusi2026lab5-postgres-1 postgres <none> linux/arm64/v8 266d3c257594 115MB 9 days ago
|
||||
mtusi2026lab5-relay-1 mtusi-messenger lab5-forward linux/arm64 44b21448c1e7 103MB 39 minutes ago
|
||||
mtusi2026lab5-s3-1 rustfs/rustfs <none> linux/arm64 ed9210d6411d 110MB 9 days ago
|
||||
mtusi2026lab5-s3-init-1 rustfs/rc <none> linux/arm64 ab024bfebee4 21.3MB 9 days ago
|
||||
mtusi2026lab5-valkey-1 valkey/valkey <none> linux/arm64 2602ace2be65 17.9MB 9 days ago
|
||||
mtusi2026lab5-worker-1 mtusi-messenger lab5-forward linux/arm64 44b21448c1e7 103MB 39 minutes ago
|
||||
exit_code: 0 elapsed_seconds: 0.177
|
||||
@@ -0,0 +1,39 @@
|
||||
date: 2026-11-06T19:35:55Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ python3 scripts/pipeline_suite.py --level 4 --output evidence/forward-final-2026-11-06/level4.json
|
||||
RUN smoke_pipeline
|
||||
PASS smoke_pipeline
|
||||
RUN worker_down_broker_restart
|
||||
PASS worker_down_broker_restart
|
||||
RUN duplicate_after_ready
|
||||
PASS duplicate_after_ready
|
||||
RUN poison_image
|
||||
PASS poison_image
|
||||
RUN s3_outage_recovers
|
||||
PASS s3_outage_recovers
|
||||
RUN retry_exhausted
|
||||
PASS retry_exhausted
|
||||
RUN image_matrix
|
||||
PASS image_matrix
|
||||
RUN crash_commit_publish
|
||||
PASS crash_commit_publish
|
||||
RUN crash_publish_confirm
|
||||
PASS crash_publish_confirm
|
||||
RUN crash_after_s3_before_commit
|
||||
PASS crash_after_s3_before_commit
|
||||
RUN crash_after_commit_before_ack
|
||||
PASS crash_after_commit_before_ack
|
||||
RUN lease_expiry_fencing
|
||||
PASS lease_expiry_fencing
|
||||
RUN replay_failed
|
||||
PASS replay_failed
|
||||
RUN malformed_message_dead_lettered
|
||||
PASS malformed_message_dead_lettered
|
||||
RUN worker_limits
|
||||
PASS worker_limits
|
||||
RUN retry_backoff_jitter
|
||||
PASS retry_backoff_jitter
|
||||
RUN failed_retention
|
||||
PASS failed_retention
|
||||
PASS: lab5 pipeline suite, report evidence/forward-final-2026-11-06/level4.json
|
||||
exit_code: 0 elapsed_seconds: 278.951
|
||||
@@ -0,0 +1,977 @@
|
||||
{
|
||||
"suite": "lab5-pipeline-idempotency",
|
||||
"started_at": "2026-11-06T19:35:55.519173Z",
|
||||
"source_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"config": {
|
||||
"base_url": "http://127.0.0.1:18085",
|
||||
"level": 4,
|
||||
"only": "",
|
||||
"expect_variants": "thumbnail,crop,optimized",
|
||||
"max_attempts": 5,
|
||||
"stall_seconds": 15.0,
|
||||
"compose": "docker compose",
|
||||
"compose_faults": "docker compose -f compose.yaml -f infra/compose.faults.yaml"
|
||||
},
|
||||
"invariants": [
|
||||
{
|
||||
"id": "terminal",
|
||||
"statement": "every 202 reaches its expected terminal state",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 33
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "single_effect",
|
||||
"statement": "one variant set per (attachment_id, pipeline_version, variant)",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_ready_rollback",
|
||||
"statement": "ready never returns to queued or processing",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"traced": 33
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "monotonic_publication",
|
||||
"statement": "published_version only moves forward",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"sampled": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bytes_match_metadata",
|
||||
"statement": "sha256, size and real dimensions match served bytes",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"verified": 28
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bounded_attempts",
|
||||
"statement": "attempt <= JOB_MAX_ATTEMPTS",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_orphans",
|
||||
"statement": "no pending outbox, messages, dead letters, staging, objects",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s3_objects": 116,
|
||||
"scoped_attachments": 33
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_lost_202",
|
||||
"statement": "every 202 is present in PostgreSQL and the API",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 33
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted_ids": [
|
||||
"01a1b25c-6798-701c-9cd8-75aafd903a0b",
|
||||
"01a1b25c-6d79-72a3-8572-6e1ce6d2fa72",
|
||||
"01a1b25c-ac61-757a-8b1c-959fc5c8da61",
|
||||
"01a1b25c-d0e5-7072-9e24-986d0eacf1e5",
|
||||
"01a1b25d-0cd9-70fb-b193-7e4ea731dd2e",
|
||||
"01a1b25d-45d0-7777-b11c-df61772945cf",
|
||||
"01a1b25d-4af2-76e5-9f8d-6ebe867595c3",
|
||||
"01a1b25d-5004-7706-a258-f9ccb0799e51",
|
||||
"01a1b25d-5165-702a-b711-f49224657d64",
|
||||
"01a1b25d-5414-742d-94e5-4cfabc6d8db2",
|
||||
"01a1b25d-557a-7727-a742-a1bf9e6dbcef",
|
||||
"01a1b25d-582b-779a-92fa-76c631891b36",
|
||||
"01a1b25d-5992-7160-b247-ba1e57c9f68b",
|
||||
"01a1b25d-5c32-70df-83ba-c52bfcd6db76",
|
||||
"01a1b25d-5d9f-701a-a08a-fa64fc29fdee",
|
||||
"01a1b25d-603d-76f3-896b-c0ab9922cf83",
|
||||
"01a1b25d-619a-7536-b909-72ff0ebf6d5a",
|
||||
"01a1b25d-642e-77e4-a17b-887d1f55d538",
|
||||
"01a1b25d-6595-75ea-a2b6-bb8ff5cbca60",
|
||||
"01a1b25d-682a-7350-8e9b-9fa1179383d9",
|
||||
"01a1b25d-6992-70e5-972e-f93c23b8dbf6",
|
||||
"01a1b25d-6c92-7370-ac06-b7d943345d62",
|
||||
"01a1b25d-7d90-757d-a6cf-f374e63cf7cb",
|
||||
"01a1b25d-a31a-7261-975c-7bde40c0e108",
|
||||
"01a1b25d-c77d-705e-b838-9d9ba15fbadf",
|
||||
"01a1b25d-f8da-76d9-b714-f7b55947a801",
|
||||
"01a1b25e-2176-73e5-8d6d-34386191c57a",
|
||||
"01a1b25e-a2f3-754b-982c-49da221caf59",
|
||||
"01a1b25f-1ffa-72fb-8c1c-fca83d40d0fb",
|
||||
"01a1b25f-31a6-7720-bd4f-60787194d5e5",
|
||||
"01a1b25f-44b2-755b-a71e-634205be8c09",
|
||||
"01a1b25f-5abe-7238-b0b2-db991857b384",
|
||||
"01a1b25f-a149-70cd-8c7f-dfd4ec7c8883"
|
||||
],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "smoke_pipeline",
|
||||
"level": 3,
|
||||
"window": "upload, ready, variants match metadata",
|
||||
"seconds": 1.1,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25c-6798-701c-9cd8-75aafd903a0b",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_down_broker_restart",
|
||||
"level": 3,
|
||||
"window": "worker down, API and broker restart",
|
||||
"seconds": 16.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25c-6d79-72a3-8572-6e1ce6d2fa72",
|
||||
"timeline": [
|
||||
{
|
||||
"at": "2026-11-06T19:36:04.210289Z",
|
||||
"step": "worker stopped",
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 3924574b030d exited Exited (0) Less than a second ago"
|
||||
]
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:04.231533Z",
|
||||
"step": "upload 202 queued",
|
||||
"attachment_id": "01a1b25c-6d79-72a3-8572-6e1ce6d2fa72"
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:04.235473Z",
|
||||
"step": "content 409 while queued"
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:04.257866Z",
|
||||
"step": "message with attachment 201, other messages work",
|
||||
"message_id": "01a1b25c-6d8b-723f-9bef-f42c91f1c442"
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:06.523597Z",
|
||||
"step": "job is in the broker queue",
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
1,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
14,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:12.043233Z",
|
||||
"step": "API replicas and relay restarted"
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:17.374725Z",
|
||||
"step": "broker restarted with its volume, job survived",
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
1,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
14,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:20.143149Z",
|
||||
"step": "worker started"
|
||||
},
|
||||
{
|
||||
"at": "2026-11-06T19:36:20.313903Z",
|
||||
"step": "ready",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_after_ready",
|
||||
"level": 3,
|
||||
"window": "redelivery of a finished job",
|
||||
"seconds": 9.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25c-ac61-757a-8b1c-959fc5c8da61",
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "poison_image",
|
||||
"level": 3,
|
||||
"window": "permanent error without retries",
|
||||
"seconds": 0.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"rejected_by_api": 415
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "s3_outage_recovers",
|
||||
"level": 3,
|
||||
"window": "transient error with retry",
|
||||
"seconds": 12.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25c-d0e5-7072-9e24-986d0eacf1e5",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b25c-d0ec-7129-babc-51241a730c94",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "retry_exhausted",
|
||||
"level": 3,
|
||||
"window": "transient error until JOB_MAX_ATTEMPTS",
|
||||
"seconds": 17.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25d-0cd9-70fb-b193-7e4ea731dd2e",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b25d-0ce5-71be-bcde-4db51cbd6a9f",
|
||||
"pipeline_version": 1,
|
||||
"status": "failed",
|
||||
"attempt": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "image_matrix",
|
||||
"level": 4,
|
||||
"window": "limits and variants",
|
||||
"seconds": 11.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"images": [
|
||||
{
|
||||
"file": "png-rgb-320x200.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-rgba-300x300.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-palette-trns-200x100.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-gray-17x1000.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-gray-alpha-640x480.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-gray16-300x200.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-rgba16-64x64.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-1x1.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-wide-3000x2.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-small-50x30.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-rgb-1000x750.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-gray-801x601.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-cmyk-400x300.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-exif6-400x200.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-exif3-300x200.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-rgb-4000x3000.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-exactly-10mib.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-over-10mib.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-over-pixels-8001x5000.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "jpeg-over-pixels-10000x5000.jpg",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-truncated.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-corrupt-idat.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "jpeg-truncated.jpg",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-zero-width.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "not-an-image.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "gif-declared-as-png.png",
|
||||
"http": "rejected"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_commit_publish",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before publish",
|
||||
"seconds": 9.5,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25d-7d90-757d-a6cf-f374e63cf7cb",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": false,
|
||||
"status": "queued",
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 57ef736182d7 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b25d-7d90-757d-a6cf-f374e63cf7cb/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b25d-7d90-757d-a6cf-f374e63cf7cb/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b25d-7d90-757d-a6cf-f374e63cf7cb/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_publish_confirm",
|
||||
"level": 4,
|
||||
"window": "after publish, before confirm",
|
||||
"seconds": 9.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25d-a31a-7261-975c-7bde40c0e108",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": [
|
||||
false
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
14,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 9f63b40078d5 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b25d-a31a-7261-975c-7bde40c0e108/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b25d-a31a-7261-975c-7bde40c0e108/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b25d-a31a-7261-975c-7bde40c0e108/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
"enqueued",
|
||||
"claimed",
|
||||
"done",
|
||||
"duplicate_noop"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_s3_before_commit",
|
||||
"level": 4,
|
||||
"window": "after S3 write, before COMMIT",
|
||||
"seconds": 12.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25d-c77d-705e-b838-9d9ba15fbadf",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"variant_rows": 0,
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 c74820bbdab3 exited Exited (137) Less than a second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b25d-c77d-705e-b838-9d9ba15fbadf/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b25d-c77d-705e-b838-9d9ba15fbadf/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b25d-c77d-705e-b838-9d9ba15fbadf/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before ack",
|
||||
"seconds": 10.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25d-f8da-76d9-b714-f7b55947a801",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "ready",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b25d-f8da-76d9-b714-f7b55947a801/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b25d-f8da-76d9-b714-f7b55947a801/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b25d-f8da-76d9-b714-f7b55947a801/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
14,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 5accc3314905 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b25d-f8da-76d9-b714-f7b55947a801/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b25d-f8da-76d9-b714-f7b55947a801/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b25d-f8da-76d9-b714-f7b55947a801/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lease_expiry_fencing",
|
||||
"level": 4,
|
||||
"window": "stalled worker, lease expiry",
|
||||
"seconds": 33.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25e-2176-73e5-8d6d-34386191c57a",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b25e-2183-77e4-b40b-4afd30e5e553",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "lease_expired",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "fenced",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "replay_failed",
|
||||
"level": 4,
|
||||
"window": "operator replay",
|
||||
"seconds": 28.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25e-a2f3-754b-982c-49da221caf59",
|
||||
"replay": {
|
||||
"result": "replayed",
|
||||
"attachment_id": "01a1b25e-a2f3-754b-982c-49da221caf59",
|
||||
"operator": "cli"
|
||||
},
|
||||
"replay_of_ready": {
|
||||
"result": "noop",
|
||||
"attachment_id": "01a1b25e-a2f3-754b-982c-49da221caf59",
|
||||
"operator": "cli"
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 3
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 3
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 4
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 4
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 5
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 5
|
||||
},
|
||||
{
|
||||
"kind": "failed",
|
||||
"attempt": 5
|
||||
},
|
||||
{
|
||||
"kind": "replayed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "replay_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "malformed_message_dead_lettered",
|
||||
"level": 4,
|
||||
"window": "message that is not a job goes to the DLQ",
|
||||
"seconds": 3.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"dead_letters": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_limits",
|
||||
"level": 4,
|
||||
"window": "render time and memory limits, 40 Mpx in the worker limit",
|
||||
"seconds": 15.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"image": {
|
||||
"file": "png-at-pixel-limit-8000x5000.png",
|
||||
"bytes": 116714,
|
||||
"pixels": 40000000
|
||||
},
|
||||
"render_timeout": {
|
||||
"seconds": 0.5,
|
||||
"attachment_id": "01a1b25f-1ffa-72fb-8c1c-fca83d40d0fb",
|
||||
"error_code": "processing_failed",
|
||||
"worker": "running"
|
||||
},
|
||||
"render_memory": {
|
||||
"mib": 200,
|
||||
"attachment_id": "01a1b25f-31a6-7720-bd4f-60787194d5e5",
|
||||
"error_code": "processing_failed",
|
||||
"worker": "running"
|
||||
},
|
||||
"default_limits": {
|
||||
"attachment_id": "01a1b25f-44b2-755b-a71e-634205be8c09",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
],
|
||||
"memory_peak_mib": 423.0,
|
||||
"memory_max_mib": 1024.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "retry_backoff_jitter",
|
||||
"level": 4,
|
||||
"window": "backoff with equal jitter between attempts",
|
||||
"seconds": 18.1,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25f-5abe-7238-b0b2-db991857b384",
|
||||
"delays": [
|
||||
{
|
||||
"attempt": 2,
|
||||
"delay": 0.722422
|
||||
},
|
||||
{
|
||||
"attempt": 3,
|
||||
"delay": 1.010937
|
||||
},
|
||||
{
|
||||
"attempt": 4,
|
||||
"delay": 2.240832
|
||||
},
|
||||
{
|
||||
"attempt": 5,
|
||||
"delay": 4.845013
|
||||
}
|
||||
],
|
||||
"share_of_ceiling": [
|
||||
0.722,
|
||||
0.505,
|
||||
0.56,
|
||||
0.606
|
||||
],
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b25f-5ac6-7404-bd51-464f6f4e81f9",
|
||||
"pipeline_version": 1,
|
||||
"status": "failed",
|
||||
"attempt": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "failed_retention",
|
||||
"level": 4,
|
||||
"window": "failed staging kept until retention, then replay expires",
|
||||
"seconds": 21.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b25f-a149-70cd-8c7f-dfd4ec7c8883",
|
||||
"staging_before": "kept",
|
||||
"retention_seconds": 86400,
|
||||
"aged_only": "01a1b25f-a149-70cd-8c7f-dfd4ec7c8883",
|
||||
"replay": {
|
||||
"result": "expired",
|
||||
"attachment_id": "01a1b25f-a149-70cd-8c7f-dfd4ec7c8883",
|
||||
"operator": "cli"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"result": "PASS",
|
||||
"finished_at": "2026-11-06T19:40:34.408683Z"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
date: 2026-11-06T19:33:31Z commit: f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071
|
||||
environment: {}
|
||||
$ make lint
|
||||
.venv/bin/ruff check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
All checks passed!
|
||||
.venv/bin/ruff format --check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
194 files already formatted
|
||||
.venv/bin/ty check src student-tests alembic
|
||||
All checks passed!
|
||||
exit_code: 0 elapsed_seconds: 0.175
|
||||
@@ -0,0 +1,154 @@
|
||||
date: 2026-11-06T19:34:10Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ python3 student-tests/tools/forward_network.py
|
||||
{
|
||||
"checks": [
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "42617369632080",
|
||||
"status": 401,
|
||||
"instance": "9aa2e31be8d1"
|
||||
},
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "426173696320ff",
|
||||
"status": 401,
|
||||
"instance": "05aaa8c023d0"
|
||||
},
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "426173696320c3a9",
|
||||
"status": 401,
|
||||
"instance": "9aa2e31be8d1"
|
||||
},
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "42617369632059577870593255366332566a636d5630ff",
|
||||
"status": 401,
|
||||
"instance": "05aaa8c023d0"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'\\x00'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "9aa2e31be8d1"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'\\x00abc'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "05aaa8c023d0"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'abc\\x00def'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "9aa2e31be8d1"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'abc\\x00'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "05aaa8c023d0"
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'\\x00'",
|
||||
"instances": [
|
||||
"05aaa8c023d0",
|
||||
"9aa2e31be8d1"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'\\x00abc'",
|
||||
"instances": [
|
||||
"9aa2e31be8d1",
|
||||
"05aaa8c023d0"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'abc\\x00def'",
|
||||
"instances": [
|
||||
"05aaa8c023d0",
|
||||
"9aa2e31be8d1"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'abc\\x00'",
|
||||
"instances": [
|
||||
"9aa2e31be8d1",
|
||||
"05aaa8c023d0"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_access",
|
||||
"status": [
|
||||
404,
|
||||
404
|
||||
]
|
||||
},
|
||||
{
|
||||
"case": "logout_across_replicas",
|
||||
"status": [
|
||||
204,
|
||||
401,
|
||||
401,
|
||||
401,
|
||||
401
|
||||
]
|
||||
}
|
||||
],
|
||||
"instances": [
|
||||
"05aaa8c023d0",
|
||||
"9aa2e31be8d1"
|
||||
],
|
||||
"pass": true
|
||||
}
|
||||
exit_code: 0 elapsed_seconds: 0.309
|
||||
@@ -0,0 +1,28 @@
|
||||
date: 2026-11-06T20:15:44Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {}
|
||||
$ openspec validate --all --strict
|
||||
- Validating...
|
||||
✓ spec/lab1-event-publication
|
||||
✓ spec/lab1-messenger-chats
|
||||
✓ spec/lab1-messenger-history
|
||||
✓ spec/lab1-messenger-identity
|
||||
✓ spec/lab1-service-operability
|
||||
✓ spec/lab2-auth-sessions
|
||||
✓ spec/lab2-dependency-failures
|
||||
✓ spec/lab2-history-index
|
||||
✓ spec/lab2-persistent-storage
|
||||
✓ spec/lab2-session-cache
|
||||
✓ spec/lab3-failover-operations
|
||||
✓ spec/lab3-idempotent-messages
|
||||
✓ spec/lab3-load-balancing
|
||||
✓ spec/lab4-attachments
|
||||
✓ spec/lab4-object-storage
|
||||
✓ spec/lab4-storage-reconciler
|
||||
✓ spec/lab4-upload-resilience
|
||||
✓ spec/lab5-attachment-pipeline
|
||||
✓ spec/lab5-image-variants
|
||||
✓ spec/lab5-job-delivery
|
||||
✓ spec/lab5-job-recovery
|
||||
✓ spec/lab5-versioned-pipeline
|
||||
Totals: 22 passed, 0 failed (22 items)
|
||||
exit_code: 0 elapsed_seconds: 0.883
|
||||
@@ -0,0 +1,103 @@
|
||||
date: 2026-11-06T19:34:42Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ docker events --since 2026-11-06T19:34:12Z --until 2026-11-06T19:34:25Z --filter label=com.docker.compose.project=mtusi2026lab5 --filter type=container --format '{{.Time}} {{.Action}} {{index .Actor.Attributes "com.docker.compose.service"}} {{.Actor.ID}}'
|
||||
1793993656 start s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993656 restart s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993656 start postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993656 restart postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993656 start valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993656 restart valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993657 exec_create: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993657 exec_start: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993657 exec_die postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993657 health_status: healthy postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993657 stop broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993657 die broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993657 start broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993657 restart broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993658 start lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993658 start migrate 5d51411de45f8fbacb9fee4ec2371f2789e1a131bc1dfbca088f47f3c54f1d6d
|
||||
1793993658 exec_create: /bin/sh -c REDISCLI_AUTH="$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)" valkey-cli ping | grep -q PONG valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993658 exec_start: /bin/sh -c REDISCLI_AUTH="$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)" valkey-cli ping | grep -q PONG valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993658 exec_die valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993658 health_status: healthy valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993659 exec_create: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993659 exec_start: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993659 exec_die postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993659 exec_create: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993659 exec_start: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993659 exec_die lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993659 die migrate 5d51411de45f8fbacb9fee4ec2371f2789e1a131bc1dfbca088f47f3c54f1d6d
|
||||
1793993659 exec_create: rabbitmq-diagnostics -q check_port_connectivity broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993659 exec_start: rabbitmq-diagnostics -q check_port_connectivity broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993660 exec_create: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993660 exec_start: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993660 exec_die lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993660 exec_die broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993660 health_status: healthy broker 7502f5de6c6ab0db594e6219925ad7902cf8d7fe7497d27821b3be9dbf4c8367
|
||||
1793993660 exec_create: /bin/sh -c REDISCLI_AUTH="$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)" valkey-cli ping | grep -q PONG valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993660 exec_start: /bin/sh -c REDISCLI_AUTH="$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)" valkey-cli ping | grep -q PONG valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993660 exec_die valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993661 exec_create: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993661 exec_start: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993661 exec_die postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993661 exec_create: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993661 exec_start: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993661 exec_die lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993661 exec_create: curl -fsS -o /dev/null http://127.0.0.1:9000/health/ready s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993661 exec_start: curl -fsS -o /dev/null http://127.0.0.1:9000/health/ready s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993661 exec_die s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993661 health_status: healthy s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993662 start s3-init 6f3b94b9aeef24b8921a45a5d6f53a1dbbb337301787fd474496d9a24da65ed9
|
||||
1793993662 exec_create: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993662 exec_start: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993662 exec_die lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993662 die s3-init 6f3b94b9aeef24b8921a45a5d6f53a1dbbb337301787fd474496d9a24da65ed9
|
||||
1793993662 start relay e889034026d64612636cdc5bb76a459d6120b8308f17235b891275b8ef7a9a71
|
||||
1793993662 start api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993662 start worker 74094f96bf2a59407c41992311f2b072eed37ca5e9dc49689009c2ebbbda1206
|
||||
1793993662 start api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993662 exec_create: /bin/sh -c REDISCLI_AUTH="$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)" valkey-cli ping | grep -q PONG valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993662 exec_start: /bin/sh -c REDISCLI_AUTH="$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)" valkey-cli ping | grep -q PONG valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993663 exec_die valkey ded0278c8247d20dc80367cff60cadf32ff0f0ef1c307137df734d5919094a97
|
||||
1793993663 exec_create: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993663 exec_start: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993663 exec_create: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993663 exec_start: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993663 exec_create: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993663 exec_start: pg_isready -h 127.0.0.1 -U messenger -d messenger postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993663 exec_die postgres 96be64dd1ce1d5df8def913cc66a94afa8f145acff473a60a2d774942a042ae2
|
||||
1793993663 exec_create: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993663 exec_start: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993663 exec_die lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993663 exec_die api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993663 exec_die api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993663 exec_create: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993663 exec_start: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993663 exec_create: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993663 exec_start: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993663 exec_create: curl -fsS -o /dev/null http://127.0.0.1:9000/health/ready s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993663 exec_start: curl -fsS -o /dev/null http://127.0.0.1:9000/health/ready s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993663 exec_die api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993663 exec_die s3 81f5d92e8b6e8e44a6627f4a6e8f9852773d2855e16fc4333402859430356a7f
|
||||
1793993664 exec_die api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993664 exec_create: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993664 exec_start: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993664 exec_create: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993664 exec_start: python -c import sys,urllib.request;sys.exit(urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status!=200) api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993664 exec_die api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993664 health_status: healthy api 05aaa8c023d0644da201a9ae5909b29fb55135c1b73efef6db502d4fa6c15a01
|
||||
1793993664 exec_create: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993664 exec_start: wget -q -O /dev/null http://127.0.0.1:8404/healthz lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993664 exec_die api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993664 health_status: healthy api 9aa2e31be8d1f979e8059b563bae7449b0b3000707aad8d3b2bdb8fa06d1e442
|
||||
1793993664 exec_die lb 20bab8f9174fdb8c5b27adef097b805bef60d288609fae162bc2dffcadbbe40c
|
||||
1793993664 exec_create: python -c import os,sys,time;sys.exit(time.time()-os.stat('/tmp/heartbeat').st_mtime>30) relay e889034026d64612636cdc5bb76a459d6120b8308f17235b891275b8ef7a9a71
|
||||
1793993664 exec_start: python -c import os,sys,time;sys.exit(time.time()-os.stat('/tmp/heartbeat').st_mtime>30) relay e889034026d64612636cdc5bb76a459d6120b8308f17235b891275b8ef7a9a71
|
||||
1793993664 exec_create: python -c import os,sys,time;sys.exit(time.time()-os.stat('/tmp/heartbeat').st_mtime>30) worker 74094f96bf2a59407c41992311f2b072eed37ca5e9dc49689009c2ebbbda1206
|
||||
1793993664 exec_start: python -c import os,sys,time;sys.exit(time.time()-os.stat('/tmp/heartbeat').st_mtime>30) worker 74094f96bf2a59407c41992311f2b072eed37ca5e9dc49689009c2ebbbda1206
|
||||
1793993664 exec_die relay e889034026d64612636cdc5bb76a459d6120b8308f17235b891275b8ef7a9a71
|
||||
1793993664 health_status: healthy relay e889034026d64612636cdc5bb76a459d6120b8308f17235b891275b8ef7a9a71
|
||||
1793993664 exec_die worker 74094f96bf2a59407c41992311f2b072eed37ca5e9dc49689009c2ebbbda1206
|
||||
1793993664 health_status: healthy worker 74094f96bf2a59407c41992311f2b072eed37ca5e9dc49689009c2ebbbda1206
|
||||
exit_code: 0 elapsed_seconds: 0.017
|
||||
@@ -0,0 +1,7 @@
|
||||
date: 2026-11-06T19:34:12Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1:18085"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit_code: 0 elapsed_seconds: 12.835
|
||||
@@ -0,0 +1,12 @@
|
||||
date: 2026-11-06T19:34:42Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make restore
|
||||
scripts/restore.sh
|
||||
Container mtusi2026lab5-api-1 Running
|
||||
Container mtusi2026lab5-api-2 Starting
|
||||
Container mtusi2026lab5-api-2 Started
|
||||
Container mtusi2026lab5-api-1 Waiting
|
||||
Container mtusi2026lab5-api-2 Waiting
|
||||
Container mtusi2026lab5-api-1 Healthy
|
||||
Container mtusi2026lab5-api-2 Healthy
|
||||
exit_code: 0 elapsed_seconds: 2.493
|
||||
@@ -0,0 +1,8 @@
|
||||
date: 2026-11-06T20:13:43Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ docker volume ls --filter label=com.docker.compose.project=mtusi2026lab5 --format '{{.Name}}'
|
||||
mtusi2026lab5_broker-data
|
||||
mtusi2026lab5_pgdata
|
||||
mtusi2026lab5_s3data
|
||||
mtusi2026lab5_valkeydata
|
||||
exit_code: 0 elapsed_seconds: 0.022
|
||||
@@ -0,0 +1,6 @@
|
||||
date: 2026-11-06T19:34:08Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make test
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:18085"
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
exit_code: 0 elapsed_seconds: 1.474
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,253 @@
|
||||
M AGENTS.md
|
||||
M REPORT.md
|
||||
M evidence/README.md
|
||||
A evidence/forward-final-2026-11-06/failover-command.txt
|
||||
A evidence/forward-final-2026-11-06/failover-d4c8d53d7433.txt
|
||||
A evidence/forward-final-2026-11-06/failover-upload-command.txt
|
||||
A evidence/forward-final-2026-11-06/failover-upload.json
|
||||
A evidence/forward-final-2026-11-06/final-checks.txt
|
||||
A evidence/forward-final-2026-11-06/final-smoke.txt
|
||||
A evidence/forward-final-2026-11-06/findings.json
|
||||
A evidence/forward-final-2026-11-06/forward-audit.txt
|
||||
A evidence/forward-final-2026-11-06/haproxy-errors.txt
|
||||
A evidence/forward-final-2026-11-06/known-minor-http.txt
|
||||
A evidence/forward-final-2026-11-06/known-minor.txt
|
||||
A evidence/forward-final-2026-11-06/limits.txt
|
||||
A evidence/forward-final-2026-11-06/load-command.txt
|
||||
A evidence/forward-final-2026-11-06/load.txt
|
||||
A evidence/forward-final-2026-11-06/load/run1.json
|
||||
A evidence/forward-final-2026-11-06/load/run2.json
|
||||
A evidence/forward-final-2026-11-06/load/run3.json
|
||||
A evidence/forward-final-2026-11-06/main-down.txt
|
||||
A evidence/forward-final-2026-11-06/measurement-summary.json
|
||||
A evidence/forward-final-2026-11-06/measurement-summary.txt
|
||||
A evidence/forward-final-2026-11-06/memory-1.txt
|
||||
A evidence/forward-final-2026-11-06/memory-2.txt
|
||||
A evidence/forward-final-2026-11-06/memory-3.txt
|
||||
A evidence/forward-final-2026-11-06/memory/run1/slots3-10mib-c40.json
|
||||
A evidence/forward-final-2026-11-06/memory/run1/summary.txt
|
||||
A evidence/forward-final-2026-11-06/memory/run2/slots3-10mib-c40.json
|
||||
A evidence/forward-final-2026-11-06/memory/run2/summary.txt
|
||||
A evidence/forward-final-2026-11-06/memory/run3/slots3-10mib-c40.json
|
||||
A evidence/forward-final-2026-11-06/memory/run3/summary.txt
|
||||
A evidence/forward-final-2026-11-06/network-regressions.txt
|
||||
A evidence/forward-final-2026-11-06/offline-checks-rerun.txt
|
||||
A evidence/forward-final-2026-11-06/offline-checks.txt
|
||||
A evidence/forward-final-2026-11-06/openspec-archive.txt
|
||||
A evidence/forward-final-2026-11-06/performance-after.txt
|
||||
A evidence/forward-final-2026-11-06/performance-before.txt
|
||||
A evidence/forward-final-2026-11-06/persistence-command.txt
|
||||
A evidence/forward-final-2026-11-06/persistence-rerun.txt
|
||||
A evidence/forward-final-2026-11-06/precommit-checks.txt
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo.txt
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/apply-1.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/apply-2.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/check-after.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/check-before.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/check-under-load.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/demo.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/dry-run.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/healed.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/lock-busy.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/ready-before.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/ready-load.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/ready-untouched.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/s3-down.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/sigterm.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-demo/under-load.json
|
||||
A evidence/forward-final-2026-11-06/reconcile-down.txt
|
||||
A evidence/forward-final-2026-11-06/reconcile-smoke.txt
|
||||
A evidence/forward-final-2026-11-06/reconcile-up.txt
|
||||
A evidence/forward-final-2026-11-06/restore.txt
|
||||
A evidence/forward-final-2026-11-06/retained-cost-audit.txt
|
||||
A evidence/forward-final-2026-11-06/s3-outage-command.txt
|
||||
A evidence/forward-final-2026-11-06/s3-outage.json
|
||||
A evidence/forward-final-2026-11-06/shutdown-state.txt
|
||||
A evidence/forward-final-2026-11-06/smoke.txt
|
||||
A evidence/forward-final-2026-11-06/source-manifest.json
|
||||
A evidence/forward-final-2026-11-06/stack-faults.txt
|
||||
A evidence/forward-final-2026-11-06/up.txt
|
||||
A evidence/forward-port.md
|
||||
A evidence/load-validation.md
|
||||
A evidence/png-final-2026-11-06/concurrent-reconcile.py
|
||||
A evidence/png-final-2026-11-06/concurrent-reconcile.txt
|
||||
A evidence/png-final-2026-11-06/concurrent-reconcile/check-under-load.json
|
||||
A evidence/png-final-2026-11-06/concurrent-reconcile/checks.json
|
||||
A evidence/png-final-2026-11-06/concurrent-reconcile/ready-load.json
|
||||
A evidence/png-final-2026-11-06/concurrent-reconcile/under-load.json
|
||||
A evidence/png-final-2026-11-06/cost-reaudit.json
|
||||
A evidence/png-final-2026-11-06/cost-reaudit.txt
|
||||
A evidence/png-final-2026-11-06/final-audit.py
|
||||
A evidence/png-final-2026-11-06/final-audit.txt
|
||||
A evidence/png-final-2026-11-06/final-smoke.txt
|
||||
A evidence/png-final-2026-11-06/findings.json
|
||||
A evidence/png-final-2026-11-06/high-depth-retry.txt
|
||||
A evidence/png-final-2026-11-06/high-depth.json
|
||||
A evidence/png-final-2026-11-06/high-depth.py
|
||||
A evidence/png-final-2026-11-06/high-depth.txt
|
||||
A evidence/png-final-2026-11-06/host-after-memory.txt
|
||||
A evidence/png-final-2026-11-06/host-after-reconcile.txt
|
||||
A evidence/png-final-2026-11-06/host-before.txt
|
||||
A evidence/png-final-2026-11-06/host-memory-1.txt
|
||||
A evidence/png-final-2026-11-06/host-memory-2.txt
|
||||
A evidence/png-final-2026-11-06/host-memory-3.txt
|
||||
A evidence/png-final-2026-11-06/host-reconcile.txt
|
||||
A evidence/png-final-2026-11-06/image-code.txt
|
||||
A evidence/png-final-2026-11-06/limits-command.txt
|
||||
A evidence/png-final-2026-11-06/limits.txt
|
||||
A evidence/png-final-2026-11-06/main-down.txt
|
||||
A evidence/png-final-2026-11-06/memory-1.txt
|
||||
A evidence/png-final-2026-11-06/memory-2.txt
|
||||
A evidence/png-final-2026-11-06/memory-3.txt
|
||||
A evidence/png-final-2026-11-06/memory-summary.json
|
||||
A evidence/png-final-2026-11-06/memory-summary.txt
|
||||
A evidence/png-final-2026-11-06/offline.txt
|
||||
A evidence/png-final-2026-11-06/png-roundtrip-retry.txt
|
||||
A evidence/png-final-2026-11-06/png-roundtrip.json
|
||||
A evidence/png-final-2026-11-06/png-roundtrip.py
|
||||
A evidence/png-final-2026-11-06/png-roundtrip.txt
|
||||
A evidence/png-final-2026-11-06/post-memory-invariants.json
|
||||
A evidence/png-final-2026-11-06/post-memory-invariants.txt
|
||||
A evidence/png-final-2026-11-06/precommit-checks.txt
|
||||
A evidence/png-final-2026-11-06/reconcile-down.txt
|
||||
A evidence/png-final-2026-11-06/reconcile-up.txt
|
||||
A evidence/png-final-2026-11-06/retained-audit.json
|
||||
A evidence/png-final-2026-11-06/runtime-settings.txt
|
||||
A evidence/png-final-2026-11-06/shutdown-state.txt
|
||||
A evidence/png-final-2026-11-06/smoke.txt
|
||||
A evidence/png-final-2026-11-06/source-manifest.json
|
||||
A evidence/png-final-2026-11-06/student-s3-retry.txt
|
||||
A evidence/png-final-2026-11-06/student-test.txt
|
||||
A evidence/png-final-2026-11-06/summarize-memory.py
|
||||
A evidence/png-final-2026-11-06/up.txt
|
||||
A evidence/png-final-2026-11-06/upload-faults.txt
|
||||
A evidence/png-final-2026-11-06/upload-memory/run1/slots3-10mib-c10.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run1/slots3-10mib-c20.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run1/slots3-10mib-c40.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run1/slots3-1mib-c10.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run1/slots3-1mib-c20.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run1/slots3-1mib-c40.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run1/summary.txt
|
||||
A evidence/png-final-2026-11-06/upload-memory/run2/slots3-10mib-c10.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run2/slots3-10mib-c20.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run2/slots3-10mib-c40.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run2/slots3-1mib-c10.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run2/slots3-1mib-c20.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run2/slots3-1mib-c40.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run2/summary.txt
|
||||
A evidence/png-final-2026-11-06/upload-memory/run3/slots3-10mib-c10.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run3/slots3-10mib-c20.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run3/slots3-10mib-c40.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run3/slots3-1mib-c10.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run3/slots3-1mib-c20.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run3/slots3-1mib-c40.json
|
||||
A evidence/png-final-2026-11-06/upload-memory/run3/summary.txt
|
||||
A evidence/png-header-fix/NOTES.md
|
||||
A evidence/png-header-fix/api-collection.txt
|
||||
A evidence/png-header-fix/before-confirmed.txt
|
||||
A evidence/png-header-fix/before.txt
|
||||
A evidence/png-header-fix/boundaries.txt
|
||||
A evidence/png-header-fix/check-final.txt
|
||||
A evidence/png-header-fix/check.txt
|
||||
A evidence/png-header-fix/lint-final.txt
|
||||
A evidence/png-header-fix/lint-initial.txt
|
||||
A evidence/png-header-fix/lint.txt
|
||||
A evidence/png-header-fix/manifest.json
|
||||
A evidence/png-header-fix/openspec-final.txt
|
||||
A evidence/png-header-fix/openspec.txt
|
||||
A evidence/png-header-fix/specs-sync.txt
|
||||
A evidence/png-header-fix/stack-collection.txt
|
||||
A evidence/png-header-fix/targeted.txt
|
||||
A evidence/png-header-fix/unit.txt
|
||||
A evidence/png-header-fix/validate.txt
|
||||
A evidence/png-validation-fix/NOTES.md
|
||||
A evidence/png-validation-fix/before.txt
|
||||
A evidence/png-validation-fix/boundaries.txt
|
||||
A evidence/png-validation-fix/check-final.txt
|
||||
A evidence/png-validation-fix/check.txt
|
||||
A evidence/png-validation-fix/lint-archive.txt
|
||||
A evidence/png-validation-fix/lint-final.txt
|
||||
A evidence/png-validation-fix/lint.txt
|
||||
A evidence/png-validation-fix/manifest.json
|
||||
A evidence/png-validation-fix/openspec-final.txt
|
||||
A evidence/png-validation-fix/openspec-specs.txt
|
||||
A evidence/png-validation-fix/unit-final.txt
|
||||
A evidence/png-validation-fix/unit.txt
|
||||
A evidence/png-validation-fix/validate.txt
|
||||
A evidence/report-audit-2026-11-06.md
|
||||
M evidence/sqlalchemy-2026-11-06/README.md
|
||||
M evidence/sqlalchemy-2026-11-06/grade3/NOTES.md
|
||||
M evidence/sqlalchemy-2026-11-06/grade4/NOTES.md
|
||||
M evidence/sqlalchemy-2026-11-06/track5/NOTES.md
|
||||
M infra/haproxy/haproxy.cfg
|
||||
A openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/.openspec.yaml
|
||||
A openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/design.md
|
||||
A openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/proposal.md
|
||||
A openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/specs/lab2-session-cache/spec.md
|
||||
A openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/specs/lab3-load-balancing/spec.md
|
||||
A openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/tasks.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-header-consistency/.openspec.yaml
|
||||
A openspec/changes/archive/2026-11-06-fix-png-header-consistency/design.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-header-consistency/proposal.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-header-consistency/specs/lab4-attachments/spec.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-header-consistency/tasks.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-pixel-validation/.openspec.yaml
|
||||
A openspec/changes/archive/2026-11-06-fix-png-pixel-validation/design.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-pixel-validation/proposal.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-pixel-validation/specs/lab4-attachments/spec.md
|
||||
A openspec/changes/archive/2026-11-06-fix-png-pixel-validation/tasks.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/.openspec.yaml
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/design.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/proposal.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab1-messenger-chats/spec.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab1-messenger-history/spec.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab1-messenger-identity/spec.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab2-auth-sessions/spec.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab2-session-cache/spec.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab3-load-balancing/spec.md
|
||||
A openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/tasks.md
|
||||
A openspec/changes/archive/2026-11-06-reject-non-ascii-basic/.openspec.yaml
|
||||
A openspec/changes/archive/2026-11-06-reject-non-ascii-basic/design.md
|
||||
A openspec/changes/archive/2026-11-06-reject-non-ascii-basic/proposal.md
|
||||
A openspec/changes/archive/2026-11-06-reject-non-ascii-basic/specs/lab2-auth-sessions/spec.md
|
||||
A openspec/changes/archive/2026-11-06-reject-non-ascii-basic/tasks.md
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/.openspec.yaml
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/design.md
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/proposal.md
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab1-messenger-chats/spec.md
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab1-messenger-history/spec.md
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab1-messenger-identity/spec.md
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab2-auth-sessions/spec.md
|
||||
A openspec/changes/archive/2026-11-06-reject-nul-text-inputs/tasks.md
|
||||
M openspec/config.yaml
|
||||
M openspec/specs/lab1-messenger-chats/spec.md
|
||||
M openspec/specs/lab1-messenger-history/spec.md
|
||||
M openspec/specs/lab1-messenger-identity/spec.md
|
||||
M openspec/specs/lab2-auth-sessions/spec.md
|
||||
M openspec/specs/lab2-session-cache/spec.md
|
||||
M openspec/specs/lab3-load-balancing/spec.md
|
||||
M openspec/specs/lab4-attachments/spec.md
|
||||
M src/messenger/attachments/infrastructure/images.py
|
||||
A src/messenger/attachments/infrastructure/png.py
|
||||
M src/messenger/identity/application/handlers.py
|
||||
M src/messenger/identity/domain/values.py
|
||||
M src/messenger/identity/entrypoints/authentication.py
|
||||
M src/messenger/identity/infrastructure/postgres.py
|
||||
M src/messenger/identity/infrastructure/valkey.py
|
||||
M src/messenger/messaging/domain/values.py
|
||||
M student-tests/api/test_attachments.py
|
||||
M student-tests/api/test_cache.py
|
||||
A student-tests/api/test_nul_validation.py
|
||||
M student-tests/api/test_sessions.py
|
||||
M student-tests/pictures.py
|
||||
M student-tests/stack/test_attachment_faults.py
|
||||
A student-tests/tools/forward_network.py
|
||||
A student-tests/tools/lb_errors/client.py
|
||||
A student-tests/tools/lb_errors/compose.yaml
|
||||
A student-tests/tools/lb_errors/server.py
|
||||
M student-tests/unit/test_authentication.py
|
||||
A student-tests/unit/test_haproxy_errors.py
|
||||
A student-tests/unit/test_image_inspection.py
|
||||
A student-tests/unit/test_nul_inputs.py
|
||||
A student-tests/unit/test_png_upload.py
|
||||
A student-tests/unit/test_session_cache.py
|
||||
@@ -0,0 +1,29 @@
|
||||
date: 2026-11-06T19:36:43Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {}
|
||||
$ openspec validate --all --strict
|
||||
- Validating...
|
||||
✓ change/forward-lab4-final-review-fixes
|
||||
✓ spec/lab1-event-publication
|
||||
✓ spec/lab1-messenger-chats
|
||||
✓ spec/lab1-messenger-history
|
||||
✓ spec/lab1-messenger-identity
|
||||
✓ spec/lab1-service-operability
|
||||
✓ spec/lab2-auth-sessions
|
||||
✓ spec/lab2-dependency-failures
|
||||
✓ spec/lab2-history-index
|
||||
✓ spec/lab2-persistent-storage
|
||||
✓ spec/lab2-session-cache
|
||||
✓ spec/lab3-failover-operations
|
||||
✓ spec/lab3-idempotent-messages
|
||||
✓ spec/lab3-load-balancing
|
||||
✓ spec/lab4-attachments
|
||||
✓ spec/lab4-object-storage
|
||||
✓ spec/lab4-storage-reconciler
|
||||
✓ spec/lab4-upload-resilience
|
||||
✓ spec/lab5-attachment-pipeline
|
||||
✓ spec/lab5-image-variants
|
||||
✓ spec/lab5-job-delivery
|
||||
✓ spec/lab5-job-recovery
|
||||
✓ spec/lab5-versioned-pipeline
|
||||
Totals: 23 passed, 0 failed (23 items)
|
||||
exit_code: 0 elapsed_seconds: 0.915
|
||||
@@ -0,0 +1,4 @@
|
||||
date: 2026-11-06T20:13:43Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ docker ps -a --filter label=com.docker.compose.project=mtusi2026lab5 --format '{{.Names}} {{.Status}}'
|
||||
exit_code: 0 elapsed_seconds: 0.021
|
||||
@@ -0,0 +1,68 @@
|
||||
date: 2026-11-06T19:30:50Z commit: f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071
|
||||
environment: {"NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ make student-test
|
||||
.venv/bin/pytest
|
||||
============================= test session starts ==============================
|
||||
platform darwin -- Python 3.14.5, pytest-9.1.1, pluggy-1.6.0
|
||||
rootdir: <repo>
|
||||
configfile: pyproject.toml
|
||||
testpaths: student-tests
|
||||
plugins: asyncio-1.4.0, anyio-4.15.1
|
||||
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
|
||||
collected 839 items / 19 deselected / 820 selected
|
||||
|
||||
student-tests/adapters/test_rabbitmq.py .... [ 0%]
|
||||
student-tests/adapters/test_s3_storage.py ... [ 0%]
|
||||
student-tests/api/test_access.py ......... [ 1%]
|
||||
student-tests/api/test_attachments.py .................................. [ 6%]
|
||||
...... [ 6%]
|
||||
student-tests/api/test_bounded_contexts.py .................... [ 9%]
|
||||
student-tests/api/test_cache.py ............ [ 10%]
|
||||
student-tests/api/test_concurrency.py .... [ 11%]
|
||||
student-tests/api/test_consistency.py ........ [ 12%]
|
||||
student-tests/api/test_drain.py .. [ 12%]
|
||||
student-tests/api/test_events.py ...... [ 13%]
|
||||
student-tests/api/test_idempotency.py ............... [ 15%]
|
||||
student-tests/api/test_instance.py .... [ 15%]
|
||||
student-tests/api/test_job_returning.py . [ 15%]
|
||||
student-tests/api/test_message_attachments.py ............. [ 17%]
|
||||
student-tests/api/test_migrations.py ................................... [ 21%]
|
||||
. [ 21%]
|
||||
student-tests/api/test_negative.py ..................................... [ 26%]
|
||||
[ 26%]
|
||||
student-tests/api/test_nul_validation.py ................. [ 28%]
|
||||
student-tests/api/test_operability.py .............. [ 29%]
|
||||
student-tests/api/test_pagination.py .................. [ 32%]
|
||||
student-tests/api/test_pipeline.py ............. [ 33%]
|
||||
student-tests/api/test_pool.py ............ [ 35%]
|
||||
student-tests/api/test_reconciler.py ........... [ 36%]
|
||||
student-tests/api/test_recovery.py ............ [ 37%]
|
||||
student-tests/api/test_sessions.py ...................... [ 40%]
|
||||
student-tests/api/test_timeout.py ........ [ 41%]
|
||||
student-tests/api/test_upload_consistency.py ......... [ 42%]
|
||||
student-tests/api/test_versioned_pipeline.py ........... [ 44%]
|
||||
student-tests/api/test_wire_format.py .. [ 44%]
|
||||
student-tests/unit/test_attachments_domain.py .......................... [ 47%]
|
||||
. [ 47%]
|
||||
student-tests/unit/test_authentication.py ............................. [ 51%]
|
||||
student-tests/unit/test_cursor.py ........... [ 52%]
|
||||
student-tests/unit/test_domain.py ...................................... [ 57%]
|
||||
.. [ 57%]
|
||||
student-tests/unit/test_haproxy_errors.py ............... [ 59%]
|
||||
student-tests/unit/test_image_inspection.py ............................ [ 62%]
|
||||
........................................................................ [ 71%]
|
||||
........................................................................ [ 80%]
|
||||
..................................................... [ 86%]
|
||||
student-tests/unit/test_nul_inputs.py ...................... [ 89%]
|
||||
student-tests/unit/test_pipeline_domain.py ....................... [ 92%]
|
||||
student-tests/unit/test_png_upload.py .. [ 92%]
|
||||
student-tests/unit/test_probe.py .............. [ 94%]
|
||||
student-tests/unit/test_reconcile_measurements.py ...... [ 94%]
|
||||
student-tests/unit/test_render_pool.py .....s. [ 95%]
|
||||
student-tests/unit/test_renderer.py .................... [ 98%]
|
||||
student-tests/unit/test_scaling.py ..... [ 98%]
|
||||
student-tests/unit/test_session_cache.py .......... [ 99%]
|
||||
student-tests/unit/test_timeouts.py . [100%]
|
||||
|
||||
========== 819 passed, 1 skipped, 19 deselected in 150.77s (0:02:30) ===========
|
||||
exit_code: 0 elapsed_seconds: 152.249
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"created_at": "2026-11-06T20:15:05.165820+00:00",
|
||||
"runtime_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"source_base": "d7478726a85791c21e065d58f610735a9e687433",
|
||||
"source_final": "4ed889c1e4008e3f6040ae2534bef99262d3b8ce",
|
||||
"result": "PASS",
|
||||
"qualification": "functional idempotency, not performance",
|
||||
"runs": [
|
||||
{
|
||||
"file": "track-run1.json",
|
||||
"result": "PASS",
|
||||
"accepted": 13,
|
||||
"s3_objects": 58,
|
||||
"scenario_passes": 13,
|
||||
"invariant_passes": 8,
|
||||
"utc_interval_seconds": 181.175,
|
||||
"capture_monotonic_seconds": 181.089,
|
||||
"time_comparable": true,
|
||||
"started_at": "2026-11-06T19:41:07.846676Z",
|
||||
"finished_at": "2026-11-06T19:44:09.021981Z"
|
||||
},
|
||||
{
|
||||
"file": "track-run2.json",
|
||||
"result": "PASS",
|
||||
"accepted": 13,
|
||||
"s3_objects": 58,
|
||||
"scenario_passes": 13,
|
||||
"invariant_passes": 8,
|
||||
"utc_interval_seconds": 1161.195,
|
||||
"capture_monotonic_seconds": 186.458,
|
||||
"time_comparable": false,
|
||||
"started_at": "2026-11-06T19:44:12.189859Z",
|
||||
"finished_at": "2026-11-06T20:03:33.385306Z"
|
||||
},
|
||||
{
|
||||
"file": "track-run3.json",
|
||||
"result": "PASS",
|
||||
"accepted": 13,
|
||||
"s3_objects": 58,
|
||||
"scenario_passes": 13,
|
||||
"invariant_passes": 8,
|
||||
"utc_interval_seconds": 571.513,
|
||||
"capture_monotonic_seconds": 180.259,
|
||||
"time_comparable": false,
|
||||
"started_at": "2026-11-06T20:03:36.581788Z",
|
||||
"finished_at": "2026-11-06T20:13:08.094368Z"
|
||||
}
|
||||
],
|
||||
"accepted_unique": 39,
|
||||
"s3_objects_scoped_total": 174,
|
||||
"scenario_passes": 39,
|
||||
"invariant_passes": 24,
|
||||
"previous_qualification": {
|
||||
"source_sha": "9ba3076fa8ba707de932e053fc22f455d83b3210",
|
||||
"result": "PASS",
|
||||
"accepted_unique": 39,
|
||||
"scenario_passes": 39,
|
||||
"invariant_passes": 24,
|
||||
"s3_objects_scoped_total": 174
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"file": "conditions-before.json",
|
||||
"at": "2026-11-06T19:33:37.768460+00:00",
|
||||
"other_projects": {}
|
||||
},
|
||||
{
|
||||
"file": "conditions-level4-middle.json",
|
||||
"at": "2026-11-06T19:37:39.764784+00:00",
|
||||
"other_projects": {}
|
||||
},
|
||||
{
|
||||
"file": "conditions-level4-start.json",
|
||||
"at": "2026-11-06T19:35:55.131308+00:00",
|
||||
"other_projects": {}
|
||||
},
|
||||
{
|
||||
"file": "conditions-stopped.json",
|
||||
"at": "2026-11-06T20:13:44.524983+00:00",
|
||||
"other_projects": {}
|
||||
},
|
||||
{
|
||||
"file": "conditions-track-after1.json",
|
||||
"at": "2026-11-06T19:44:11.713768+00:00",
|
||||
"other_projects": {}
|
||||
},
|
||||
{
|
||||
"file": "conditions-track-after2.json",
|
||||
"at": "2026-11-06T20:03:36.100013+00:00",
|
||||
"other_projects": {}
|
||||
},
|
||||
{
|
||||
"file": "conditions-track-after3.json",
|
||||
"at": "2026-11-06T20:13:10.819292+00:00",
|
||||
"other_projects": {}
|
||||
},
|
||||
{
|
||||
"file": "conditions-track-start.json",
|
||||
"at": "2026-11-06T19:41:07.614200+00:00",
|
||||
"other_projects": {}
|
||||
}
|
||||
],
|
||||
"limitations": [
|
||||
"Run2/3 UTC vs host monotonic discontinuity: durations excluded from performance comparison; cause not determined.",
|
||||
"Shared Docker; snapshots are not continuous host monitoring.",
|
||||
"Scoped invariants preserve historical failed jobs and DLQ; total DLQ is not zero.",
|
||||
"Three prior minor findings retained."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,931 @@
|
||||
{
|
||||
"suite": "lab5-pipeline-idempotency",
|
||||
"started_at": "2026-11-06T19:41:07.846676Z",
|
||||
"source_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"config": {
|
||||
"base_url": "http://127.0.0.1:18085",
|
||||
"level": 5,
|
||||
"only": "smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version",
|
||||
"expect_variants": "thumbnail,crop,optimized",
|
||||
"max_attempts": 5,
|
||||
"stall_seconds": 15.0,
|
||||
"compose": "docker compose",
|
||||
"compose_faults": "docker compose -f compose.yaml -f infra/compose.faults.yaml"
|
||||
},
|
||||
"invariants": [
|
||||
{
|
||||
"id": "terminal",
|
||||
"statement": "every 202 reaches its expected terminal state",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "single_effect",
|
||||
"statement": "one variant set per (attachment_id, pipeline_version, variant)",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_ready_rollback",
|
||||
"statement": "ready never returns to queued or processing",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"traced": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "monotonic_publication",
|
||||
"statement": "published_version only moves forward",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"sampled": 9
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bytes_match_metadata",
|
||||
"statement": "sha256, size and real dimensions match served bytes",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"verified": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bounded_attempts",
|
||||
"statement": "attempt <= JOB_MAX_ATTEMPTS",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_orphans",
|
||||
"statement": "no pending outbox, messages, dead letters, staging, objects",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s3_objects": 58,
|
||||
"scoped_attachments": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_lost_202",
|
||||
"statement": "every 202 is present in PostgreSQL and the API",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 13
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted_ids": [
|
||||
"01a1b261-2b7c-723b-adaa-36aae90d5ba9",
|
||||
"01a1b261-3097-7119-bd24-566826bc759f",
|
||||
"01a1b261-5fa6-71a2-ae6d-aed2e8dba114",
|
||||
"01a1b261-8616-7726-8fa0-729c543c9d4d",
|
||||
"01a1b261-aa40-7119-98fa-459a12a87f44",
|
||||
"01a1b261-db51-7322-bb7c-cebceeeb3434",
|
||||
"01a1b262-0323-708d-bd6f-e289de2517f0",
|
||||
"01a1b262-80ce-77b9-a06e-703ea919c23d",
|
||||
"01a1b262-ad9d-7697-b61e-51512b70f14f",
|
||||
"01a1b262-cc93-722f-abdd-4f64e7053e81",
|
||||
"01a1b263-0651-77f5-b7a2-ba5e4b1efb7e",
|
||||
"01a1b263-42a7-747b-94fc-6883399bce32",
|
||||
"01a1b263-6eef-748f-9586-463f39b1f958"
|
||||
],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "smoke_pipeline",
|
||||
"level": 3,
|
||||
"window": "upload, ready, variants match metadata",
|
||||
"seconds": 1.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b261-2b7c-723b-adaa-36aae90d5ba9",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_after_ready",
|
||||
"level": 3,
|
||||
"window": "redelivery of a finished job",
|
||||
"seconds": 8.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b261-3097-7119-bd24-566826bc759f",
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_commit_publish",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before publish",
|
||||
"seconds": 10.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b261-5fa6-71a2-ae6d-aed2e8dba114",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": false,
|
||||
"status": "queued",
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 bc3404f3f831 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b261-5fa6-71a2-ae6d-aed2e8dba114/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b261-5fa6-71a2-ae6d-aed2e8dba114/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b261-5fa6-71a2-ae6d-aed2e8dba114/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_publish_confirm",
|
||||
"level": 4,
|
||||
"window": "after publish, before confirm",
|
||||
"seconds": 9.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b261-8616-7726-8fa0-729c543c9d4d",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": [
|
||||
false
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 62c4e8521629 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b261-8616-7726-8fa0-729c543c9d4d/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b261-8616-7726-8fa0-729c543c9d4d/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b261-8616-7726-8fa0-729c543c9d4d/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
"enqueued",
|
||||
"claimed",
|
||||
"done",
|
||||
"duplicate_noop"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_s3_before_commit",
|
||||
"level": 4,
|
||||
"window": "after S3 write, before COMMIT",
|
||||
"seconds": 12.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b261-aa40-7119-98fa-459a12a87f44",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"variant_rows": 0,
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 fe05cac972ad exited Exited (137) Less than a second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b261-aa40-7119-98fa-459a12a87f44/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b261-aa40-7119-98fa-459a12a87f44/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b261-aa40-7119-98fa-459a12a87f44/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before ack",
|
||||
"seconds": 9.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b261-db51-7322-bb7c-cebceeeb3434",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "ready",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b261-db51-7322-bb7c-cebceeeb3434/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b261-db51-7322-bb7c-cebceeeb3434/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b261-db51-7322-bb7c-cebceeeb3434/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
1
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 2a8f04b56ab2 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b261-db51-7322-bb7c-cebceeeb3434/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b261-db51-7322-bb7c-cebceeeb3434/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b261-db51-7322-bb7c-cebceeeb3434/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lease_expiry_fencing",
|
||||
"level": 4,
|
||||
"window": "stalled worker, lease expiry",
|
||||
"seconds": 32.5,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b262-0323-708d-bd6f-e289de2517f0",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b262-032e-71dc-bfc1-02900b06d16e",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "lease_expired",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "fenced",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_before_side_effect",
|
||||
"level": 5,
|
||||
"window": "after claim, before side effects",
|
||||
"seconds": 11.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b262-80ce-77b9-a06e-703ea919c23d",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b262-80dd-70b0-8327-e597de4cb7c5",
|
||||
"pipeline_version": 1,
|
||||
"status": "processing",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 0be3452a3553 exited Exited (137) Less than a second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b262-80ce-77b9-a06e-703ea919c23d/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b262-80ce-77b9-a06e-703ea919c23d/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b262-80ce-77b9-a06e-703ea919c23d/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_kill_mid_task",
|
||||
"level": 5,
|
||||
"window": "SIGKILL during processing",
|
||||
"seconds": 11.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b262-ad9d-7697-b61e-51512b70f14f",
|
||||
"exit_code": 137,
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 bf11095f0cc5 exited Exited (137) Less than a second ago"
|
||||
],
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b262-adab-7616-b560-bcf253929767",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_in_flight",
|
||||
"level": 5,
|
||||
"window": "two copies of one job in flight",
|
||||
"seconds": 14.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b262-cc93-722f-abdd-4f64e7053e81",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b262-cc93-722f-abdd-4f64e7053e81/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b262-cc93-722f-abdd-4f64e7053e81/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b262-cc93-722f-abdd-4f64e7053e81/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reorder_attempts",
|
||||
"level": 5,
|
||||
"window": "attempt 2 delivered before attempt 1",
|
||||
"seconds": 15.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b263-0651-77f5-b7a2-ba5e4b1efb7e",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b263-065d-760e-8443-0cade3509844",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reorder_versions",
|
||||
"level": 5,
|
||||
"window": "v2 delivered before v1",
|
||||
"seconds": 11.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b263-42a7-747b-94fc-6883399bce32",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b263-42ae-7345-8d88-db0e13669503",
|
||||
"pipeline_version": 1,
|
||||
"status": "superseded",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"job_id": "01a1b263-45fd-703b-8aca-13e2f7a9e86f",
|
||||
"pipeline_version": 2,
|
||||
"status": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"v2_before_v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
},
|
||||
"after_v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b263-42a7-747b-94fc-6883399bce32/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "stale_after_new_version",
|
||||
"level": 5,
|
||||
"window": "v1 job after v2 is published",
|
||||
"seconds": 5.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b263-6eef-748f-9586-463f39b1f958",
|
||||
"published_version": 2,
|
||||
"v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 1820,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2462,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 4679,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"published": 1
|
||||
},
|
||||
"v2_before_stale": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
},
|
||||
"v2_after_stale": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b263-6eef-748f-9586-463f39b1f958/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"result": "PASS",
|
||||
"finished_at": "2026-11-06T19:44:09.021981Z"
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
date: 2026-11-06T19:41:07Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make track2 TRACK2_OUTPUT=evidence/forward-final-2026-11-06/track-run1.json
|
||||
BASE_URL="http://127.0.0.1:18085" python3 scripts/pipeline_suite.py --level 5 --only "smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version" --output "evidence/forward-final-2026-11-06/track-run1.json"
|
||||
RUN smoke_pipeline
|
||||
PASS smoke_pipeline
|
||||
RUN duplicate_after_ready
|
||||
PASS duplicate_after_ready
|
||||
RUN crash_commit_publish
|
||||
PASS crash_commit_publish
|
||||
RUN crash_publish_confirm
|
||||
PASS crash_publish_confirm
|
||||
RUN crash_after_s3_before_commit
|
||||
PASS crash_after_s3_before_commit
|
||||
RUN crash_after_commit_before_ack
|
||||
PASS crash_after_commit_before_ack
|
||||
RUN lease_expiry_fencing
|
||||
PASS lease_expiry_fencing
|
||||
RUN crash_before_side_effect
|
||||
PASS crash_before_side_effect
|
||||
RUN worker_kill_mid_task
|
||||
PASS worker_kill_mid_task
|
||||
RUN duplicate_in_flight
|
||||
PASS duplicate_in_flight
|
||||
RUN reorder_attempts
|
||||
PASS reorder_attempts
|
||||
RUN reorder_versions
|
||||
PASS reorder_versions
|
||||
RUN stale_after_new_version
|
||||
PASS stale_after_new_version
|
||||
PASS: lab5 pipeline suite, report evidence/forward-final-2026-11-06/track-run1.json
|
||||
exit_code: 0 elapsed_seconds: 181.089
|
||||
@@ -0,0 +1,931 @@
|
||||
{
|
||||
"suite": "lab5-pipeline-idempotency",
|
||||
"started_at": "2026-11-06T19:44:12.189859Z",
|
||||
"source_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"config": {
|
||||
"base_url": "http://127.0.0.1:18085",
|
||||
"level": 5,
|
||||
"only": "smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version",
|
||||
"expect_variants": "thumbnail,crop,optimized",
|
||||
"max_attempts": 5,
|
||||
"stall_seconds": 15.0,
|
||||
"compose": "docker compose",
|
||||
"compose_faults": "docker compose -f compose.yaml -f infra/compose.faults.yaml"
|
||||
},
|
||||
"invariants": [
|
||||
{
|
||||
"id": "terminal",
|
||||
"statement": "every 202 reaches its expected terminal state",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "single_effect",
|
||||
"statement": "one variant set per (attachment_id, pipeline_version, variant)",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_ready_rollback",
|
||||
"statement": "ready never returns to queued or processing",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"traced": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "monotonic_publication",
|
||||
"statement": "published_version only moves forward",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"sampled": 9
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bytes_match_metadata",
|
||||
"statement": "sha256, size and real dimensions match served bytes",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"verified": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bounded_attempts",
|
||||
"statement": "attempt <= JOB_MAX_ATTEMPTS",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_orphans",
|
||||
"statement": "no pending outbox, messages, dead letters, staging, objects",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s3_objects": 58,
|
||||
"scoped_attachments": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_lost_202",
|
||||
"statement": "every 202 is present in PostgreSQL and the API",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 13
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted_ids": [
|
||||
"01a1b263-fcb9-777e-9a86-6c3167785973",
|
||||
"01a1b264-01f5-768a-b40a-cfb9d82c4bf1",
|
||||
"01a1b264-23ed-775b-bf17-a75e04e481d6",
|
||||
"01a1b264-4b82-77e4-8aca-42730d0f2d96",
|
||||
"01a1b264-705b-722f-9b95-338078dc917a",
|
||||
"01a1b264-b086-711c-8696-11a16cfa2d23",
|
||||
"01a1b264-dab1-7162-a3af-63561302700f",
|
||||
"01a1b265-5ac6-72ad-ba32-11f1686e3413",
|
||||
"01a1b265-86a8-7504-aafe-cb33ac4f43d5",
|
||||
"01a1b265-a463-7213-933d-ba5674fce13a",
|
||||
"01a1b265-e024-7724-a378-5ce1baecda4f",
|
||||
"01a1b266-1801-7703-b28b-415bdc98e3ab",
|
||||
"01a1b266-51ef-75db-93ce-62180939bf6d"
|
||||
],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "smoke_pipeline",
|
||||
"level": 3,
|
||||
"window": "upload, ready, variants match metadata",
|
||||
"seconds": 1.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b263-fcb9-777e-9a86-6c3167785973",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_after_ready",
|
||||
"level": 3,
|
||||
"window": "redelivery of a finished job",
|
||||
"seconds": 4.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b264-01f5-768a-b40a-cfb9d82c4bf1",
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_commit_publish",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before publish",
|
||||
"seconds": 10.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b264-23ed-775b-bf17-a75e04e481d6",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": false,
|
||||
"status": "queued",
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 750b1db1e5b9 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b264-23ed-775b-bf17-a75e04e481d6/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b264-23ed-775b-bf17-a75e04e481d6/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b264-23ed-775b-bf17-a75e04e481d6/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_publish_confirm",
|
||||
"level": 4,
|
||||
"window": "after publish, before confirm",
|
||||
"seconds": 9.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b264-4b82-77e4-8aca-42730d0f2d96",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": [
|
||||
false
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 cf0f15b540a2 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b264-4b82-77e4-8aca-42730d0f2d96/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b264-4b82-77e4-8aca-42730d0f2d96/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b264-4b82-77e4-8aca-42730d0f2d96/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
"enqueued",
|
||||
"claimed",
|
||||
"done",
|
||||
"duplicate_noop"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_s3_before_commit",
|
||||
"level": 4,
|
||||
"window": "after S3 write, before COMMIT",
|
||||
"seconds": 16.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b264-705b-722f-9b95-338078dc917a",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"variant_rows": 0,
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 11ee5203c9f4 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b264-705b-722f-9b95-338078dc917a/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b264-705b-722f-9b95-338078dc917a/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b264-705b-722f-9b95-338078dc917a/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before ack",
|
||||
"seconds": 10.7,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b264-b086-711c-8696-11a16cfa2d23",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "ready",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b264-b086-711c-8696-11a16cfa2d23/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b264-b086-711c-8696-11a16cfa2d23/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b264-b086-711c-8696-11a16cfa2d23/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 4dc41b1f9798 exited Exited (137) 2 seconds ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b264-b086-711c-8696-11a16cfa2d23/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b264-b086-711c-8696-11a16cfa2d23/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b264-b086-711c-8696-11a16cfa2d23/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lease_expiry_fencing",
|
||||
"level": 4,
|
||||
"window": "stalled worker, lease expiry",
|
||||
"seconds": 32.9,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b264-dab1-7162-a3af-63561302700f",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b264-dab9-709b-ae3a-d18bba7d4bd6",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "lease_expired",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "fenced",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_before_side_effect",
|
||||
"level": 5,
|
||||
"window": "after claim, before side effects",
|
||||
"seconds": 11.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b265-5ac6-72ad-ba32-11f1686e3413",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b265-5ace-72ec-a148-0f338de29b33",
|
||||
"pipeline_version": 1,
|
||||
"status": "processing",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 c3b5e7891d44 exited Exited (137) Less than a second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b265-5ac6-72ad-ba32-11f1686e3413/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b265-5ac6-72ad-ba32-11f1686e3413/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b265-5ac6-72ad-ba32-11f1686e3413/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_kill_mid_task",
|
||||
"level": 5,
|
||||
"window": "SIGKILL during processing",
|
||||
"seconds": 10.9,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b265-86a8-7504-aafe-cb33ac4f43d5",
|
||||
"exit_code": 137,
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 6f41446aca4e exited Exited (137) Less than a second ago"
|
||||
],
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b265-86b1-71e0-926d-44689d0960f2",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_in_flight",
|
||||
"level": 5,
|
||||
"window": "two copies of one job in flight",
|
||||
"seconds": 14.5,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b265-a463-7213-933d-ba5674fce13a",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b265-a463-7213-933d-ba5674fce13a/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b265-a463-7213-933d-ba5674fce13a/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b265-a463-7213-933d-ba5674fce13a/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reorder_attempts",
|
||||
"level": 5,
|
||||
"window": "attempt 2 delivered before attempt 1",
|
||||
"seconds": 14.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b265-e024-7724-a378-5ce1baecda4f",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b265-e02a-7420-90db-2d4bc9e16069",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reorder_versions",
|
||||
"level": 5,
|
||||
"window": "v2 delivered before v1",
|
||||
"seconds": 15.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b266-1801-7703-b28b-415bdc98e3ab",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b266-1807-71dd-b184-f1cc3c0787fc",
|
||||
"pipeline_version": 1,
|
||||
"status": "superseded",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"job_id": "01a1b266-1b6a-7062-b44f-7372e7d5d25b",
|
||||
"pipeline_version": 2,
|
||||
"status": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"v2_before_v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
},
|
||||
"after_v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b266-1801-7703-b28b-415bdc98e3ab/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "stale_after_new_version",
|
||||
"level": 5,
|
||||
"window": "v1 job after v2 is published",
|
||||
"seconds": 5.1,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b266-51ef-75db-93ce-62180939bf6d",
|
||||
"published_version": 2,
|
||||
"v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 1820,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2462,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 4679,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"published": 1
|
||||
},
|
||||
"v2_before_stale": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
},
|
||||
"v2_after_stale": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b266-51ef-75db-93ce-62180939bf6d/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"result": "PASS",
|
||||
"finished_at": "2026-11-06T20:03:33.385306Z"
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
date: 2026-11-06T19:44:12Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make track2 TRACK2_OUTPUT=evidence/forward-final-2026-11-06/track-run2.json
|
||||
BASE_URL="http://127.0.0.1:18085" python3 scripts/pipeline_suite.py --level 5 --only "smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version" --output "evidence/forward-final-2026-11-06/track-run2.json"
|
||||
RUN smoke_pipeline
|
||||
PASS smoke_pipeline
|
||||
RUN duplicate_after_ready
|
||||
PASS duplicate_after_ready
|
||||
RUN crash_commit_publish
|
||||
PASS crash_commit_publish
|
||||
RUN crash_publish_confirm
|
||||
PASS crash_publish_confirm
|
||||
RUN crash_after_s3_before_commit
|
||||
PASS crash_after_s3_before_commit
|
||||
RUN crash_after_commit_before_ack
|
||||
PASS crash_after_commit_before_ack
|
||||
RUN lease_expiry_fencing
|
||||
PASS lease_expiry_fencing
|
||||
RUN crash_before_side_effect
|
||||
PASS crash_before_side_effect
|
||||
RUN worker_kill_mid_task
|
||||
PASS worker_kill_mid_task
|
||||
RUN duplicate_in_flight
|
||||
PASS duplicate_in_flight
|
||||
RUN reorder_attempts
|
||||
PASS reorder_attempts
|
||||
RUN reorder_versions
|
||||
PASS reorder_versions
|
||||
RUN stale_after_new_version
|
||||
PASS stale_after_new_version
|
||||
PASS: lab5 pipeline suite, report evidence/forward-final-2026-11-06/track-run2.json
|
||||
exit_code: 0 elapsed_seconds: 186.458
|
||||
@@ -0,0 +1,931 @@
|
||||
{
|
||||
"suite": "lab5-pipeline-idempotency",
|
||||
"started_at": "2026-11-06T20:03:36.581788Z",
|
||||
"source_sha": "0e921116610d289716af0a40ec823376eb8bbcbc",
|
||||
"config": {
|
||||
"base_url": "http://127.0.0.1:18085",
|
||||
"level": 5,
|
||||
"only": "smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version",
|
||||
"expect_variants": "thumbnail,crop,optimized",
|
||||
"max_attempts": 5,
|
||||
"stall_seconds": 15.0,
|
||||
"compose": "docker compose",
|
||||
"compose_faults": "docker compose -f compose.yaml -f infra/compose.faults.yaml"
|
||||
},
|
||||
"invariants": [
|
||||
{
|
||||
"id": "terminal",
|
||||
"statement": "every 202 reaches its expected terminal state",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "single_effect",
|
||||
"statement": "one variant set per (attachment_id, pipeline_version, variant)",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_ready_rollback",
|
||||
"statement": "ready never returns to queued or processing",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"traced": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "monotonic_publication",
|
||||
"statement": "published_version only moves forward",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"sampled": 9
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bytes_match_metadata",
|
||||
"statement": "sha256, size and real dimensions match served bytes",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"verified": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bounded_attempts",
|
||||
"statement": "attempt <= JOB_MAX_ATTEMPTS",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_orphans",
|
||||
"statement": "no pending outbox, messages, dead letters, staging, objects",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s3_objects": 58,
|
||||
"scoped_attachments": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_lost_202",
|
||||
"statement": "every 202 is present in PostgreSQL and the API",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 13
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted_ids": [
|
||||
"01a1b275-c08b-737f-8cbf-a46c06f36b18",
|
||||
"01a1b275-c485-7621-9a62-27d9626e70bd",
|
||||
"01a1b275-e3a2-77cf-924d-d1e5033890ea",
|
||||
"01a1b276-085c-7557-b9d5-52cdba18141a",
|
||||
"01a1b276-2e27-72f7-a60d-a62ff514d84c",
|
||||
"01a1b276-5ac0-722d-8390-f87c16fb4a74",
|
||||
"01a1b276-8a88-7012-ab6e-4f9f81aacb05",
|
||||
"01a1b27c-f08e-773a-a9e7-8c8db15e5f8b",
|
||||
"01a1b27d-1c15-74c9-8d08-780edafec18b",
|
||||
"01a1b27d-4ac5-72d0-9270-5e5ccb03026d",
|
||||
"01a1b27d-888c-7290-8dd4-bf65cca414bf",
|
||||
"01a1b27d-c08e-714d-9d0d-fcac5634cf91",
|
||||
"01a1b27d-fa79-71e0-bafa-29a14166bbd4"
|
||||
],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "smoke_pipeline",
|
||||
"level": 3,
|
||||
"window": "upload, ready, variants match metadata",
|
||||
"seconds": 1.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b275-c08b-737f-8cbf-a46c06f36b18",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_after_ready",
|
||||
"level": 3,
|
||||
"window": "redelivery of a finished job",
|
||||
"seconds": 4.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b275-c485-7621-9a62-27d9626e70bd",
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_commit_publish",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before publish",
|
||||
"seconds": 9.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b275-e3a2-77cf-924d-d1e5033890ea",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": false,
|
||||
"status": "queued",
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 095d7cc8eca9 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b275-e3a2-77cf-924d-d1e5033890ea/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b275-e3a2-77cf-924d-d1e5033890ea/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b275-e3a2-77cf-924d-d1e5033890ea/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_publish_confirm",
|
||||
"level": 4,
|
||||
"window": "after publish, before confirm",
|
||||
"seconds": 9.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b276-085c-7557-b9d5-52cdba18141a",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": [
|
||||
false
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-relay-1 046ef7ef79e9 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b276-085c-7557-b9d5-52cdba18141a/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b276-085c-7557-b9d5-52cdba18141a/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b276-085c-7557-b9d5-52cdba18141a/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
"enqueued",
|
||||
"claimed",
|
||||
"done",
|
||||
"duplicate_noop"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_s3_before_commit",
|
||||
"level": 4,
|
||||
"window": "after S3 write, before COMMIT",
|
||||
"seconds": 11.9,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b276-2e27-72f7-a60d-a62ff514d84c",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"variant_rows": 0,
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 47923b63ce45 exited Exited (137) Less than a second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b276-2e27-72f7-a60d-a62ff514d84c/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b276-2e27-72f7-a60d-a62ff514d84c/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b276-2e27-72f7-a60d-a62ff514d84c/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before ack",
|
||||
"seconds": 12.1,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b276-5ac0-722d-8390-f87c16fb4a74",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "ready",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b276-5ac0-722d-8390-f87c16fb4a74/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b276-5ac0-722d-8390-f87c16fb4a74/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b276-5ac0-722d-8390-f87c16fb4a74/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 6dbf9a7da303 exited Exited (137) 1 second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b276-5ac0-722d-8390-f87c16fb4a74/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b276-5ac0-722d-8390-f87c16fb4a74/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b276-5ac0-722d-8390-f87c16fb4a74/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lease_expiry_fencing",
|
||||
"level": 4,
|
||||
"window": "stalled worker, lease expiry",
|
||||
"seconds": 28.1,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b276-8a88-7012-ab6e-4f9f81aacb05",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b276-8a96-76ea-b4f9-c3f09151e48e",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "lease_expired",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "fenced",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_before_side_effect",
|
||||
"level": 5,
|
||||
"window": "after claim, before side effects",
|
||||
"seconds": 11.1,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b27c-f08e-773a-a9e7-8c8db15e5f8b",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b27c-f09c-724b-80a6-7de578bf5393",
|
||||
"pipeline_version": 1,
|
||||
"status": "processing",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 605302533a00 exited Exited (137) Less than a second ago"
|
||||
]
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b27c-f08e-773a-a9e7-8c8db15e5f8b/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b27c-f08e-773a-a9e7-8c8db15e5f8b/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b27c-f08e-773a-a9e7-8c8db15e5f8b/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_kill_mid_task",
|
||||
"level": 5,
|
||||
"window": "SIGKILL during processing",
|
||||
"seconds": 15.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b27d-1c15-74c9-8d08-780edafec18b",
|
||||
"exit_code": 137,
|
||||
"containers": [
|
||||
"mtusi2026lab5-worker-1 c236808ffd5d exited Exited (137) Less than a second ago"
|
||||
],
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b27d-1c1e-7244-a2ae-7452fed2ed84",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_in_flight",
|
||||
"level": 5,
|
||||
"window": "two copies of one job in flight",
|
||||
"seconds": 15.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b27d-4ac5-72d0-9270-5e5ccb03026d",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b27d-4ac5-72d0-9270-5e5ccb03026d/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b27d-4ac5-72d0-9270-5e5ccb03026d/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b27d-4ac5-72d0-9270-5e5ccb03026d/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reorder_attempts",
|
||||
"level": 5,
|
||||
"window": "attempt 2 delivered before attempt 1",
|
||||
"seconds": 14.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b27d-888c-7290-8dd4-bf65cca414bf",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b27d-8894-76a7-8353-5a276d88d907",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reorder_versions",
|
||||
"level": 5,
|
||||
"window": "v2 delivered before v1",
|
||||
"seconds": 15.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b27d-c08e-714d-9d0d-fcac5634cf91",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1b27d-c096-70fa-a9a2-da8f3a88bdf3",
|
||||
"pipeline_version": 1,
|
||||
"status": "superseded",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"job_id": "01a1b27d-c3f9-77a7-8556-b9025097c1ee",
|
||||
"pipeline_version": 2,
|
||||
"status": "done",
|
||||
"attempt": 1
|
||||
}
|
||||
],
|
||||
"v2_before_v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
},
|
||||
"after_v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b27d-c08e-714d-9d0d-fcac5634cf91/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "stale_after_new_version",
|
||||
"level": 5,
|
||||
"window": "v1 job after v2 is published",
|
||||
"seconds": 4.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1b27d-fa79-71e0-bafa-29a14166bbd4",
|
||||
"published_version": 2,
|
||||
"v1": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 1820,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2462,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 4679,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"published": 1
|
||||
},
|
||||
"v2_before_stale": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
},
|
||||
"v2_after_stale": {
|
||||
"status": "ready",
|
||||
"public": [
|
||||
{
|
||||
"name": "crop",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 2142,
|
||||
"width": 128,
|
||||
"height": 128,
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4"
|
||||
},
|
||||
{
|
||||
"name": "optimized",
|
||||
"content_type": "image/webp",
|
||||
"size_bytes": 2790,
|
||||
"width": 320,
|
||||
"height": 200,
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957"
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"content_type": "image/jpeg",
|
||||
"size_bytes": 5628,
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "crop",
|
||||
"sha256": "5b6fb2a66216f8ca038542acdd8482fca9d1ad79193d60ae74de3989048ec0a4",
|
||||
"size_bytes": 2142,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/2/crop-5b6fb2a66216f8ca.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "optimized",
|
||||
"sha256": "fe520c978bd45fc8f1b85863dc9dc6fc98954b45d7fe803e8e4c6b681ddc1957",
|
||||
"size_bytes": 2790,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/2/optimized-fe520c978bd45fc8.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 2,
|
||||
"name": "thumbnail",
|
||||
"sha256": "fa0db661078d4da91b241edc8b416de7755db9c9c79ae704a620ca7ad534e308",
|
||||
"size_bytes": 5628,
|
||||
"object_key": "variants/01a1b27d-fa79-71e0-bafa-29a14166bbd4/2/thumbnail-fa0db661078d4da9.jpg"
|
||||
}
|
||||
],
|
||||
"published": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"result": "PASS",
|
||||
"finished_at": "2026-11-06T20:13:08.094368Z"
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
date: 2026-11-06T20:03:36Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make track2 TRACK2_OUTPUT=evidence/forward-final-2026-11-06/track-run3.json
|
||||
BASE_URL="http://127.0.0.1:18085" python3 scripts/pipeline_suite.py --level 5 --only "smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version" --output "evidence/forward-final-2026-11-06/track-run3.json"
|
||||
RUN smoke_pipeline
|
||||
PASS smoke_pipeline
|
||||
RUN duplicate_after_ready
|
||||
PASS duplicate_after_ready
|
||||
RUN crash_commit_publish
|
||||
PASS crash_commit_publish
|
||||
RUN crash_publish_confirm
|
||||
PASS crash_publish_confirm
|
||||
RUN crash_after_s3_before_commit
|
||||
PASS crash_after_s3_before_commit
|
||||
RUN crash_after_commit_before_ack
|
||||
PASS crash_after_commit_before_ack
|
||||
RUN lease_expiry_fencing
|
||||
PASS lease_expiry_fencing
|
||||
RUN crash_before_side_effect
|
||||
PASS crash_before_side_effect
|
||||
RUN worker_kill_mid_task
|
||||
PASS worker_kill_mid_task
|
||||
RUN duplicate_in_flight
|
||||
PASS duplicate_in_flight
|
||||
RUN reorder_attempts
|
||||
PASS reorder_attempts
|
||||
RUN reorder_versions
|
||||
PASS reorder_versions
|
||||
RUN stale_after_new_version
|
||||
PASS stale_after_new_version
|
||||
PASS: lab5 pipeline suite, report evidence/forward-final-2026-11-06/track-run3.json
|
||||
exit_code: 0 elapsed_seconds: 180.259
|
||||
@@ -0,0 +1,10 @@
|
||||
date: 2026-11-06T19:30:32Z commit: f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071
|
||||
environment: {}
|
||||
$ .venv/bin/pytest -q student-tests/unit/test_png_upload.py student-tests/unit/test_image_inspection.py student-tests/unit/test_authentication.py student-tests/unit/test_nul_inputs.py student-tests/unit/test_session_cache.py student-tests/unit/test_haproxy_errors.py
|
||||
........................................................................ [ 23%]
|
||||
........................................................................ [ 47%]
|
||||
........................................................................ [ 71%]
|
||||
........................................................................ [ 95%]
|
||||
............... [100%]
|
||||
303 passed in 0.37s
|
||||
exit_code: 0 elapsed_seconds: 1.010
|
||||
@@ -0,0 +1,185 @@
|
||||
date: 2026-11-06T19:33:38Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ make up
|
||||
sh scripts/secrets.sh
|
||||
sh scripts/broker-secrets.sh
|
||||
broker and S3 worker secrets ready in secrets/ (values not printed)
|
||||
docker compose build
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 431B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 1.65kB done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load metadata for docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#4 DONE 2.1s
|
||||
|
||||
#5 [internal] load .dockerignore
|
||||
#5 transferring context: 453B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 FROM ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#6 resolve ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 0.0s done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [builder 1/7] FROM docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#7 resolve docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d 0.0s done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [internal] load build context
|
||||
#8 transferring context: 127.36kB 0.0s done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [builder 3/7] WORKDIR /build
|
||||
#9 CACHED
|
||||
|
||||
#10 [builder 2/7] COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
||||
#11 CACHED
|
||||
|
||||
#12 [builder 5/7] RUN uv sync --locked --no-dev --no-install-project --no-editable
|
||||
#12 CACHED
|
||||
|
||||
#13 [builder 6/7] COPY src ./src
|
||||
#13 DONE 0.0s
|
||||
|
||||
#14 [builder 7/7] RUN uv sync --locked --no-dev --no-editable
|
||||
#14 0.239 Resolved 84 packages in 9ms
|
||||
#14 0.255 Building mtusi-messenger @ file:///build
|
||||
#14 1.926 Built mtusi-messenger @ file:///build
|
||||
#14 1.929 Prepared 1 package in 1.67s
|
||||
#14 1.932 Installed 1 package in 2ms
|
||||
#14 2.122 Bytecode compiled 2301 files in 189ms
|
||||
#14 2.122 + mtusi-messenger==1.5.0 (from file:///build)
|
||||
#14 DONE 2.2s
|
||||
|
||||
#15 [runtime 2/6] RUN groupadd --system --gid 10001 messenger && useradd --system --uid 10001 --gid messenger --no-create-home --shell /usr/sbin/nologin messenger
|
||||
#15 CACHED
|
||||
|
||||
#16 [runtime 3/6] COPY --from=builder --chown=root:root /opt/venv /opt/venv
|
||||
#16 DONE 0.4s
|
||||
|
||||
#17 [runtime 4/6] WORKDIR /app
|
||||
#17 DONE 0.0s
|
||||
|
||||
#18 [runtime 5/6] COPY --chown=root:root alembic.ini ./
|
||||
#18 DONE 0.0s
|
||||
|
||||
#19 [runtime 6/6] COPY --chown=root:root alembic ./alembic
|
||||
#19 DONE 0.0s
|
||||
|
||||
#20 exporting to image
|
||||
#20 exporting layers
|
||||
#20 exporting layers 2.8s done
|
||||
#20 exporting manifest sha256:d3f491b8c8bfc1d595b4d78343d5f2b4788cee366efbc98f5f84095523226b10 0.0s done
|
||||
#20 exporting config sha256:4eaa1f946d2a97cd08e49a146ac39d7d81efc263869234ea0305a5b14d99d115 done
|
||||
#20 exporting attestation manifest sha256:aa40cd87a4f7a7ffd9bded199ab8ac2a1b771c0861e05a4f15a1d50bf167461f done
|
||||
#20 exporting manifest list sha256:44b21448c1e766f1029c15477e6442d20d705dff495f643573ffd1521382516b done
|
||||
#20 naming to docker.io/library/mtusi-messenger:lab5-forward done
|
||||
#20 unpacking to docker.io/library/mtusi-messenger:lab5-forward
|
||||
#20 unpacking to docker.io/library/mtusi-messenger:lab5-forward 0.6s done
|
||||
#20 DONE 3.5s
|
||||
|
||||
#21 resolving provenance for metadata file
|
||||
#21 DONE 0.0s
|
||||
api Built
|
||||
docker compose up -d --wait
|
||||
Network mtusi2026lab5_backend Creating
|
||||
Network mtusi2026lab5_backend Created
|
||||
Network mtusi2026lab5_edge Creating
|
||||
Network mtusi2026lab5_edge Created
|
||||
Container mtusi2026lab5-valkey-1 Creating
|
||||
Container mtusi2026lab5-postgres-1 Creating
|
||||
Container mtusi2026lab5-s3-1 Creating
|
||||
Container mtusi2026lab5-lb-1 Creating
|
||||
Container mtusi2026lab5-broker-1 Creating
|
||||
Container mtusi2026lab5-valkey-1 Created
|
||||
Container mtusi2026lab5-s3-1 Created
|
||||
Container mtusi2026lab5-s3-init-1 Creating
|
||||
Container mtusi2026lab5-broker-1 Created
|
||||
Container mtusi2026lab5-postgres-1 Created
|
||||
Container mtusi2026lab5-migrate-1 Creating
|
||||
Container mtusi2026lab5-lb-1 Created
|
||||
Container mtusi2026lab5-s3-init-1 Created
|
||||
Container mtusi2026lab5-migrate-1 Created
|
||||
Container mtusi2026lab5-worker-1 Creating
|
||||
Container mtusi2026lab5-api-1 Creating
|
||||
Container mtusi2026lab5-relay-1 Creating
|
||||
Container mtusi2026lab5-api-2 Creating
|
||||
Container mtusi2026lab5-relay-1 Created
|
||||
Container mtusi2026lab5-api-2 Created
|
||||
Container mtusi2026lab5-worker-1 Created
|
||||
Container mtusi2026lab5-api-1 Created
|
||||
Container mtusi2026lab5-lb-1 Starting
|
||||
Container mtusi2026lab5-postgres-1 Starting
|
||||
Container mtusi2026lab5-valkey-1 Starting
|
||||
Container mtusi2026lab5-broker-1 Starting
|
||||
Container mtusi2026lab5-s3-1 Starting
|
||||
Container mtusi2026lab5-s3-1 Started
|
||||
Container mtusi2026lab5-s3-1 Waiting
|
||||
Container mtusi2026lab5-valkey-1 Started
|
||||
Container mtusi2026lab5-postgres-1 Started
|
||||
Container mtusi2026lab5-postgres-1 Waiting
|
||||
Container mtusi2026lab5-lb-1 Started
|
||||
Container mtusi2026lab5-broker-1 Started
|
||||
Container mtusi2026lab5-postgres-1 Healthy
|
||||
Container mtusi2026lab5-migrate-1 Starting
|
||||
Container mtusi2026lab5-migrate-1 Started
|
||||
Container mtusi2026lab5-s3-1 Healthy
|
||||
Container mtusi2026lab5-s3-init-1 Starting
|
||||
Container mtusi2026lab5-s3-init-1 Started
|
||||
Container mtusi2026lab5-migrate-1 Waiting
|
||||
Container mtusi2026lab5-s3-init-1 Waiting
|
||||
Container mtusi2026lab5-s3-init-1 Waiting
|
||||
Container mtusi2026lab5-migrate-1 Waiting
|
||||
Container mtusi2026lab5-broker-1 Waiting
|
||||
Container mtusi2026lab5-migrate-1 Waiting
|
||||
Container mtusi2026lab5-s3-init-1 Waiting
|
||||
Container mtusi2026lab5-broker-1 Waiting
|
||||
Container mtusi2026lab5-migrate-1 Exited
|
||||
Container mtusi2026lab5-s3-init-1 Exited
|
||||
Container mtusi2026lab5-broker-1 Healthy
|
||||
Container mtusi2026lab5-migrate-1 Exited
|
||||
Container mtusi2026lab5-migrate-1 Exited
|
||||
Container mtusi2026lab5-api-1 Starting
|
||||
Container mtusi2026lab5-broker-1 Healthy
|
||||
Container mtusi2026lab5-s3-init-1 Exited
|
||||
Container mtusi2026lab5-worker-1 Starting
|
||||
Container mtusi2026lab5-s3-init-1 Exited
|
||||
Container mtusi2026lab5-relay-1 Starting
|
||||
Container mtusi2026lab5-api-1 Started
|
||||
Container mtusi2026lab5-api-2 Starting
|
||||
Container mtusi2026lab5-relay-1 Started
|
||||
Container mtusi2026lab5-worker-1 Started
|
||||
Container mtusi2026lab5-api-2 Started
|
||||
Container mtusi2026lab5-valkey-1 Waiting
|
||||
Container mtusi2026lab5-s3-init-1 Waiting
|
||||
Container mtusi2026lab5-s3-1 Waiting
|
||||
Container mtusi2026lab5-relay-1 Waiting
|
||||
Container mtusi2026lab5-broker-1 Waiting
|
||||
Container mtusi2026lab5-api-1 Waiting
|
||||
Container mtusi2026lab5-api-2 Waiting
|
||||
Container mtusi2026lab5-worker-1 Waiting
|
||||
Container mtusi2026lab5-postgres-1 Waiting
|
||||
Container mtusi2026lab5-migrate-1 Waiting
|
||||
Container mtusi2026lab5-lb-1 Waiting
|
||||
Container mtusi2026lab5-migrate-1 Exited
|
||||
Container mtusi2026lab5-postgres-1 Healthy
|
||||
Container mtusi2026lab5-broker-1 Healthy
|
||||
Container mtusi2026lab5-s3-1 Healthy
|
||||
Container mtusi2026lab5-s3-init-1 Exited
|
||||
Container mtusi2026lab5-valkey-1 Healthy
|
||||
Container mtusi2026lab5-api-1 Healthy
|
||||
Container mtusi2026lab5-api-2 Healthy
|
||||
Container mtusi2026lab5-relay-1 Healthy
|
||||
Container mtusi2026lab5-worker-1 Healthy
|
||||
Container mtusi2026lab5-lb-1 Healthy
|
||||
scripts/lb-wait.sh
|
||||
exit_code: 0 elapsed_seconds: 20.294
|
||||
@@ -0,0 +1,45 @@
|
||||
date: 2026-11-06T19:34:10Z commit: 0e921116610d289716af0a40ec823376eb8bbcbc
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab5", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18085", "LB_STATS_PORT": "25085", "BASE_URL": "http://127.0.0.1:18085", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:lab5-forward"}
|
||||
$ .venv/bin/pytest -m stack -s -q student-tests/stack/test_attachment_faults.py::test_user_errors_never_become_500
|
||||
10 MiB + 1 с Content-Length, тело не отправлено: 413
|
||||
10 MiB + 1 chunked: 413
|
||||
PNG 100000×100000 (бомба): 413
|
||||
PNG 8001×5000: 413
|
||||
PNG с корректными CRC и битым IDAT: 415
|
||||
PNG с повторным IHDR: 415
|
||||
обрезанный PNG: 415
|
||||
обрезанный JPEG: 415
|
||||
JPEG как image/png: 415
|
||||
GIF как image/png: 415
|
||||
WebP как image/png: 415
|
||||
текст как image/png: 415
|
||||
PNG как image/jpeg: 415
|
||||
пустое тело: 415
|
||||
application/octet-stream: 415
|
||||
без Content-Type: 415
|
||||
filename='../a.png': 400
|
||||
filename='a/b.png': 400
|
||||
filename='a\\b.png': 400
|
||||
filename='a\x00.png': 400
|
||||
filename='a\x01.png': 400
|
||||
filename='a\x7f.png': 400
|
||||
filename='': 400
|
||||
filename=' ': 400
|
||||
filename='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: 400
|
||||
filename=None: 400
|
||||
посторонний: upload в чужой чат: 404
|
||||
посторонний: метаданные: 404
|
||||
посторонний: /content: 404
|
||||
посторонний: ссылка на чужое вложение: 404
|
||||
вложение другого чата: 404
|
||||
неизвестное вложение: 404
|
||||
11 вложений: 400
|
||||
повтор вложения: 400
|
||||
невалидный UUID: 400
|
||||
пустой текст без вложений: 400
|
||||
невалидный id вложения: 400
|
||||
variant=preview: 400
|
||||
строк вложений в чате: 2 (= ответов 202); ответов в журнале реплик: 123, из них 5xx: 0
|
||||
.
|
||||
1 passed in 1.04s
|
||||
exit_code: 0 elapsed_seconds: 2.025
|
||||
@@ -0,0 +1,286 @@
|
||||
# Поздний перенос ЛР4 → ЛР5
|
||||
|
||||
Источник — только immutable snapshot `lab4-4ed889c1e4008e3f6040ae2534bef99262d3b8ce`.
|
||||
Диапазон: `d7478726a85791c21e065d58f610735a9e687433..4ed889c1e4008e3f6040ae2534bef99262d3b8ce`.
|
||||
Принимающий HEAD до переноса: `f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071`; дерево было чистым.
|
||||
253 изменённых файла: 8 src, 1 infra, 16 student-tests, 47 openspec, 179 evidence, AGENTS и REPORT.
|
||||
Миграции, зависимости, Dockerfile, compose основного стенда, Makefile, scripts и нормативные файлы в source range не менялись.
|
||||
|
||||
## Изменения и смысловое разрешение
|
||||
|
||||
- Identity: поколение заполнения кэша, атомарные Lua fill/revoke, FOR KEY SHARE, удаление SQL → invalidation → COMMIT. Потеря tombstone не позволяет вернуть отозванный токен.
|
||||
- Неверный ввод: NUL в display_name/title/text и Basic username; не-ASCII Basic. Сохраняются 400/401/404, общий формат ошибок, порядок доступа и возможность исправленного повтора с прежним ключом.
|
||||
- HAProxy: JSON escaping request_id в 502/503/504 с неизменным HTTP-заголовком.
|
||||
- PNG: один первый IHDR, CRC, zlib, Adam7, scanline sizes/filters; проверка ограниченными блоками до staging/job/outbox. Существующие worker rendering, версии 1/2, lease/fencing, cleanup и ack после COMMIT сохранены.
|
||||
- Собственные тесты и сетевые probes перенесены; ручное слияние attachment API tests сохраняет `202 queued`, message-before-ready и `settle`. PNG success в specs также адаптирован к ЛР5.
|
||||
- Семь capabilities оформлены в собственном OpenSpec change; версии и provenance guidance перенесены в config. Архивы и замеры ЛР4 не выдаются за выполнение ЛР5.
|
||||
|
||||
## Проверки и ограничения
|
||||
|
||||
Ход проверки, реальные UTC и выводы — `forward-final-2026-11-06/`. Исходные SHA в ранних файлах относятся к HEAD плюс рабочий diff переноса: это явно предкоммитные проверки. `baseline.txt` — неуспешный запуск до применения тестовых файлов (no tests ran); `baseline-regressions.txt` — 29 ожидаемых провалов и 24 PASS на исходном runtime; `unit-regressions.txt` — 303 PASS после переноса.
|
||||
|
||||
Runtime после переноса: `0e921116610d289716af0a40ec823376eb8bbcbc`. Полный student-test: 819 PASS, 1 skip (`RLIMIT_AS` только Linux), 19 stack deselected. Linux-ограничения отдельно проверены level4: 40 Мп; timeout 0.5 s и память 200 MiB дают контролируемый failed, worker жив; штатный peak 423 MiB < 1024 MiB. Публичные smoke/persistence/failover PASS (131 запись, 0 ошибок); Basic/NUL/logout через обе реплики PASS; negative upload PASS (в журнале 123 ответа, 0 5xx); LB 502/503/504 — 12 проверок PASS; cache outage PASS. Level4: 17 сценариев и 8 инвариантов PASS, 33 вложения, 28 ready с проверкой байтов, 5 ожидаемых failed, 116 S3-объектов своей выборки. Три повтора трека завершены: 39 сценариев, 24 инварианта, 39 уникальных вложений, 174 S3-объекта — PASS. В run2/3 расходятся UTC и монотонное elapsed: времена не используются для выводов о производительности. Методика, сравнение и ограничения — `forward-final-2026-11-06/RESULTS.md`, сырьё и summary.json рядом. Исторические пригодные серии `sqlalchemy-2026-11-06/track2/qualified/RESULTS.md` сохраняют прежний SHA; не объявляются новыми замерами.
|
||||
|
||||
Сохраняются ранее зарегистрированные minor: порядок одинаковых secrets в `scripts/limits.py` даёт ложный FAIL; `scripts/reconcile_track.py` — демонстратор синхронной ЛР4; отдельный replay failed upgrade v2 при ready v1 не поддержан, v1 доступна. Эти пути исходный диапазон не исправляет, дополнительных правок вне переноса не сделано.
|
||||
|
||||
Свой основной и временный стенды остановлены без удаления постоянных volumes: `down.txt`, `stopped-containers.txt`, `retained-volumes.txt`, `haproxy-errors.txt`. Фоновая нагрузка и срез после остановки — conditions-*.json.
|
||||
|
||||
## Полный перечень
|
||||
|
||||
Каждый путь source range перечислен ниже; машиночитаемый эквивалент — `forward-final-2026-11-06/source-inventory.json`, исходный `git diff --name-status` — `source-name-status.txt`.
|
||||
|
||||
| Статус | Файл источника | Решение | Основание |
|
||||
| --- | --- | --- | --- |
|
||||
| M | `AGENTS.md` | Не копируется | Инструкции/описание архитектуры ЛР4 не заменяют назначенные инструкции ЛР5; новые указания пользователя имеют приоритет. AGENTS ЛР5 сохранён. |
|
||||
| M | `REPORT.md` | Не применимо | Итоговый отчёт чужой лабораторной и её рубрика/измерения; REPORT ЛР5 сохраняется для отдельной фазы отчёта. |
|
||||
| M | `evidence/README.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/failover-command.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/failover-d4c8d53d7433.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/failover-upload-command.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/failover-upload.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/final-checks.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/final-smoke.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/findings.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/forward-audit.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/haproxy-errors.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/known-minor-http.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/known-minor.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/limits.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/load-command.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/load.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/load/run1.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/load/run2.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/load/run3.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/main-down.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/measurement-summary.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/measurement-summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory-1.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory-2.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory-3.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory/run1/slots3-10mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory/run1/summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory/run2/slots3-10mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory/run2/summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory/run3/slots3-10mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/memory/run3/summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/network-regressions.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/offline-checks-rerun.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/offline-checks.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/openspec-archive.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/performance-after.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/performance-before.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/persistence-command.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/persistence-rerun.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/precommit-checks.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/apply-1.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/apply-2.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/check-after.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/check-before.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/check-under-load.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/demo.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/dry-run.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/healed.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/lock-busy.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/ready-before.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/ready-load.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/ready-untouched.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/s3-down.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/sigterm.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-demo/under-load.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-down.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-smoke.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/reconcile-up.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/restore.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/retained-cost-audit.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/s3-outage-command.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/s3-outage.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/shutdown-state.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/smoke.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/source-manifest.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/stack-faults.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-final-2026-11-06/up.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/forward-port.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/load-validation.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/concurrent-reconcile.py` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/concurrent-reconcile.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/concurrent-reconcile/check-under-load.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/concurrent-reconcile/checks.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/concurrent-reconcile/ready-load.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/concurrent-reconcile/under-load.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/cost-reaudit.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/cost-reaudit.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/final-audit.py` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/final-audit.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/final-smoke.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/findings.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/high-depth-retry.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/high-depth.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/high-depth.py` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/high-depth.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/host-after-memory.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/host-after-reconcile.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/host-before.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/host-memory-1.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/host-memory-2.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/host-memory-3.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/host-reconcile.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/image-code.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/limits-command.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/limits.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/main-down.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/memory-1.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/memory-2.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/memory-3.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/memory-summary.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/memory-summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/offline.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/png-roundtrip-retry.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/png-roundtrip.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/png-roundtrip.py` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/png-roundtrip.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/post-memory-invariants.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/post-memory-invariants.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/precommit-checks.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/reconcile-down.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/reconcile-up.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/retained-audit.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/runtime-settings.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/shutdown-state.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/smoke.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/source-manifest.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/student-s3-retry.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/student-test.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/summarize-memory.py` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/up.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-faults.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run1/slots3-10mib-c10.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run1/slots3-10mib-c20.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run1/slots3-10mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run1/slots3-1mib-c10.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run1/slots3-1mib-c20.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run1/slots3-1mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run1/summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run2/slots3-10mib-c10.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run2/slots3-10mib-c20.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run2/slots3-10mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run2/slots3-1mib-c10.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run2/slots3-1mib-c20.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run2/slots3-1mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run2/summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run3/slots3-10mib-c10.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run3/slots3-10mib-c20.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run3/slots3-10mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run3/slots3-1mib-c10.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run3/slots3-1mib-c20.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run3/slots3-1mib-c40.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-final-2026-11-06/upload-memory/run3/summary.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/NOTES.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/api-collection.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/before-confirmed.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/before.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/boundaries.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/check-final.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/check.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/lint-final.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/lint-initial.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/lint.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/manifest.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/openspec-final.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/openspec.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/specs-sync.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/stack-collection.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/targeted.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/unit.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-header-fix/validate.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/NOTES.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/before.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/boundaries.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/check-final.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/check.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/lint-archive.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/lint-final.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/lint.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/manifest.json` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/openspec-final.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/openspec-specs.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/unit-final.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/unit.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/png-validation-fix/validate.txt` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| A | `evidence/report-audit-2026-11-06.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| M | `evidence/sqlalchemy-2026-11-06/README.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| M | `evidence/sqlalchemy-2026-11-06/grade3/NOTES.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| M | `evidence/sqlalchemy-2026-11-06/grade4/NOTES.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| M | `evidence/sqlalchemy-2026-11-06/track5/NOTES.md` | Доказательства источника, не копируются | Измерения/аудит ЛР4 привязаны к другому runtime и синхронному upload; не являются evidence ЛР5. Применимые методики реализованы перенесёнными tests/tools и новыми прогонами. |
|
||||
| M | `infra/haproxy/haproxy.cfg` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/.openspec.yaml` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/design.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/proposal.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/specs/lab2-session-cache/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/specs/lab3-load-balancing/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-lab3-review-session-cache-and-errors/tasks.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-header-consistency/.openspec.yaml` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-header-consistency/design.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-header-consistency/proposal.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-header-consistency/specs/lab4-attachments/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-header-consistency/tasks.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-pixel-validation/.openspec.yaml` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-pixel-validation/design.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-pixel-validation/proposal.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-pixel-validation/specs/lab4-attachments/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-fix-png-pixel-validation/tasks.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/.openspec.yaml` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/design.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/proposal.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab1-messenger-chats/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab1-messenger-history/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab1-messenger-identity/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab2-auth-sessions/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab2-session-cache/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/specs/lab3-load-balancing/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/tasks.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-non-ascii-basic/.openspec.yaml` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-non-ascii-basic/design.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-non-ascii-basic/proposal.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-non-ascii-basic/specs/lab2-auth-sessions/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-non-ascii-basic/tasks.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/.openspec.yaml` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/design.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/proposal.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab1-messenger-chats/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab1-messenger-history/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab1-messenger-identity/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/specs/lab2-auth-sessions/spec.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| A | `openspec/changes/archive/2026-11-06-reject-nul-text-inputs/tasks.md` | История источника, не копируется | Архив фиксирует выполнение в ЛР3/4, не в ЛР5. Его runtime/tests и требования перенесены отдельно; собственный цикл forward фиксирует выполнение ЛР5. |
|
||||
| M | `openspec/config.yaml` | Перенесено | Закреплённые версии SQLAlchemy/Alembic и две инструкции о provenance/валидации; контекст ЛР5 сохранён. |
|
||||
| M | `openspec/specs/lab1-messenger-chats/spec.md` | Смысловое слияние через delta | Сценарии исходной capability включены в forward-lab4-final-review-fixes; существующие требования ЛР5 сохранены. |
|
||||
| M | `openspec/specs/lab1-messenger-history/spec.md` | Смысловое слияние через delta | Сценарии исходной capability включены в forward-lab4-final-review-fixes; существующие требования ЛР5 сохранены. Queued/processing прикрепляются, failed даёт 409. |
|
||||
| M | `openspec/specs/lab1-messenger-identity/spec.md` | Смысловое слияние через delta | Сценарии исходной capability включены в forward-lab4-final-review-fixes; существующие требования ЛР5 сохранены. |
|
||||
| M | `openspec/specs/lab2-auth-sessions/spec.md` | Смысловое слияние через delta | Сценарии исходной capability включены в forward-lab4-final-review-fixes; существующие требования ЛР5 сохранены. |
|
||||
| M | `openspec/specs/lab2-session-cache/spec.md` | Смысловое слияние через delta | Сценарии исходной capability включены в forward-lab4-final-review-fixes; существующие требования ЛР5 сохранены. |
|
||||
| M | `openspec/specs/lab3-load-balancing/spec.md` | Смысловое слияние через delta | Сценарии исходной capability включены в forward-lab4-final-review-fixes; существующие требования ЛР5 сохранены. |
|
||||
| M | `openspec/specs/lab4-attachments/spec.md` | Смысловое слияние через delta | Сценарии исходной capability включены в forward-lab4-final-review-fixes; существующие требования ЛР5 сохранены. Успех PNG адаптирован: 202 queued, затем ready через worker. |
|
||||
| M | `src/messenger/attachments/infrastructure/images.py` | Перенесено | Ручное слияние только PillowImageInspector; ProcessPool, варианты, версии и лимиты worker сохранены. |
|
||||
| A | `src/messenger/attachments/infrastructure/png.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `src/messenger/identity/application/handlers.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `src/messenger/identity/domain/values.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `src/messenger/identity/entrypoints/authentication.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `src/messenger/identity/infrastructure/postgres.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `src/messenger/identity/infrastructure/valkey.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `src/messenger/messaging/domain/values.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `student-tests/api/test_attachments.py` | Перенесено | Ручное слияние двух негативных PNG cases и импортов; сохранены 202/queued и ожидание worker. |
|
||||
| M | `student-tests/api/test_cache.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `student-tests/api/test_nul_validation.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `student-tests/api/test_sessions.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `student-tests/pictures.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `student-tests/stack/test_attachment_faults.py` | Перенесено | Diff добавляет два негативных PNG cases; существующие хуки ЛР5 и 202 сохранены. |
|
||||
| A | `student-tests/tools/forward_network.py` | Перенесено | Порт по умолчанию адаптирован с 18084 на 18085; проверки HTTP прежние. |
|
||||
| A | `student-tests/tools/lb_errors/client.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `student-tests/tools/lb_errors/compose.yaml` | Перенесено | Подсказка API_IMAGE адаптирована к lab5; запускается project hlpipe-lab5-forward-errors, портов и volumes нет. |
|
||||
| A | `student-tests/tools/lb_errors/server.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| M | `student-tests/unit/test_authentication.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `student-tests/unit/test_haproxy_errors.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `student-tests/unit/test_image_inspection.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `student-tests/unit/test_nul_inputs.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `student-tests/unit/test_png_upload.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
| A | `student-tests/unit/test_session_cache.py` | Перенесено | Исходный diff применён к ЛР5. |
|
||||
@@ -0,0 +1,258 @@
|
||||
{
|
||||
"suite": "lab5-pipeline-idempotency",
|
||||
"started_at": "2026-10-29T00:21:40.224842Z",
|
||||
"config": {
|
||||
"base_url": "http://localhost:18085",
|
||||
"level": 3,
|
||||
"only": "",
|
||||
"expect_variants": "thumbnail",
|
||||
"max_attempts": 5,
|
||||
"stall_seconds": 15.0,
|
||||
"compose": "docker compose",
|
||||
"compose_faults": "docker compose -f compose.yaml -f infra/compose.faults.yaml"
|
||||
},
|
||||
"invariants": [
|
||||
{
|
||||
"id": "terminal",
|
||||
"statement": "every 202 reaches its expected terminal state",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "single_effect",
|
||||
"statement": "one variant set per (attachment_id, pipeline_version, variant)",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_ready_rollback",
|
||||
"statement": "ready never returns to queued or processing",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"traced": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "monotonic_publication",
|
||||
"statement": "published_version only moves forward",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"sampled": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bytes_match_metadata",
|
||||
"statement": "sha256, size and real dimensions match served bytes",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"verified": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bounded_attempts",
|
||||
"statement": "attempt <= JOB_MAX_ATTEMPTS",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_orphans",
|
||||
"statement": "no pending outbox, messages, dead letters, staging, objects",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s3": "SKIP: --s3-list is not set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_lost_202",
|
||||
"statement": "every 202 is present in PostgreSQL and the API",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 5
|
||||
}
|
||||
}
|
||||
],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "smoke_pipeline",
|
||||
"level": 3,
|
||||
"window": "upload, ready, variants match metadata",
|
||||
"seconds": 1.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a18508-c6f6-774b-ae60-24aa728ad62c",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_down_broker_restart",
|
||||
"level": 3,
|
||||
"window": "worker down, API and broker restart",
|
||||
"seconds": 24.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a18508-cd97-737c-bb03-5409de83ff8e",
|
||||
"timeline": [
|
||||
{
|
||||
"at": "2026-10-29T00:21:49.075959Z",
|
||||
"step": "worker stopped"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:21:49.095967Z",
|
||||
"step": "upload 202 queued",
|
||||
"attachment_id": "01a18508-cd97-737c-bb03-5409de83ff8e"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:21:49.099982Z",
|
||||
"step": "content 409 while queued"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:21:49.138263Z",
|
||||
"step": "message with attachment 201, other messages work",
|
||||
"message_id": "01a18508-cdad-708f-8324-18123e9c7758"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:21:54.782528Z",
|
||||
"step": "job is in the broker queue",
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
1,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:22:00.869187Z",
|
||||
"step": "API replicas and relay restarted"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:22:09.698869Z",
|
||||
"step": "broker restarted with its volume, job survived",
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
1,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:22:12.427256Z",
|
||||
"step": "worker started"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:22:12.707560Z",
|
||||
"step": "ready",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_after_ready",
|
||||
"level": 3,
|
||||
"window": "redelivery of a finished job",
|
||||
"seconds": 7.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a18509-29ee-7116-b3df-b04caf1c48e7",
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "poison_image",
|
||||
"level": 3,
|
||||
"window": "permanent error without retries",
|
||||
"seconds": 0.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"rejected_by_api": 415
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "s3_outage_recovers",
|
||||
"level": 3,
|
||||
"window": "transient error with retry",
|
||||
"seconds": 11.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a18509-4892-72ec-8f31-ea07c55239c7",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a18509-4898-70c0-9198-8af96f5da78b",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "retry_exhausted",
|
||||
"level": 3,
|
||||
"window": "transient error until JOB_MAX_ATTEMPTS",
|
||||
"seconds": 23.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a18509-8268-718e-912d-c6718d5492e0",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a18509-826e-7736-8d1e-ba66a970dc8e",
|
||||
"pipeline_version": 1,
|
||||
"status": "failed",
|
||||
"attempt": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"result": "PASS",
|
||||
"finished_at": "2026-10-29T00:23:06.519678Z"
|
||||
}
|
||||
@@ -0,0 +1,923 @@
|
||||
{
|
||||
"suite": "lab5-pipeline-idempotency",
|
||||
"started_at": "2026-10-29T00:23:06.625217Z",
|
||||
"config": {
|
||||
"base_url": "http://localhost:18085",
|
||||
"level": 4,
|
||||
"only": "",
|
||||
"expect_variants": "thumbnail,crop,optimized",
|
||||
"max_attempts": 5,
|
||||
"stall_seconds": 15.0,
|
||||
"compose": "docker compose",
|
||||
"compose_faults": "docker compose -f compose.yaml -f infra/compose.faults.yaml"
|
||||
},
|
||||
"invariants": [
|
||||
{
|
||||
"id": "terminal",
|
||||
"statement": "every 202 reaches its expected terminal state",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 33
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "single_effect",
|
||||
"statement": "one variant set per (attachment_id, pipeline_version, variant)",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_ready_rollback",
|
||||
"statement": "ready never returns to queued or processing",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"traced": 33
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "monotonic_publication",
|
||||
"statement": "published_version only moves forward",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"sampled": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bytes_match_metadata",
|
||||
"statement": "sha256, size and real dimensions match served bytes",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"verified": 28
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bounded_attempts",
|
||||
"statement": "attempt <= JOB_MAX_ATTEMPTS",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"rows": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_orphans",
|
||||
"statement": "no pending outbox, messages, dead letters, staging, objects",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
2,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s3": "SKIP: --s3-list is not set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "no_lost_202",
|
||||
"statement": "every 202 is present in PostgreSQL and the API",
|
||||
"result": "PASS",
|
||||
"details": {
|
||||
"accepted": 33
|
||||
}
|
||||
}
|
||||
],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "smoke_pipeline",
|
||||
"level": 3,
|
||||
"window": "upload, ready, variants match metadata",
|
||||
"seconds": 2.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850a-2a86-7412-ad79-91e2d1035be6",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_down_broker_restart",
|
||||
"level": 3,
|
||||
"window": "worker down, API and broker restart",
|
||||
"seconds": 22.9,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850a-35f4-7738-ae88-adcd8221f85d",
|
||||
"timeline": [
|
||||
{
|
||||
"at": "2026-10-29T00:23:21.327338Z",
|
||||
"step": "worker stopped"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:21.352082Z",
|
||||
"step": "upload 202 queued",
|
||||
"attachment_id": "01a1850a-35f4-7738-ae88-adcd8221f85d"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:21.358202Z",
|
||||
"step": "content 409 while queued"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:21.411091Z",
|
||||
"step": "message with attachment 201, other messages work",
|
||||
"message_id": "01a1850a-3612-709d-812a-314668261056"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:24.139715Z",
|
||||
"step": "job is in the broker queue",
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
1,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:30.980552Z",
|
||||
"step": "API replicas and relay restarted"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:40.688506Z",
|
||||
"step": "broker restarted with its volume, job survived",
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
1,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:43.386331Z",
|
||||
"step": "worker started"
|
||||
},
|
||||
{
|
||||
"at": "2026-10-29T00:23:43.590658Z",
|
||||
"step": "ready",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate_after_ready",
|
||||
"level": 3,
|
||||
"window": "redelivery of a finished job",
|
||||
"seconds": 5.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850a-8cee-7426-8784-3914f1216d71",
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "duplicate_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "poison_image",
|
||||
"level": 3,
|
||||
"window": "permanent error without retries",
|
||||
"seconds": 0.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"rejected_by_api": 415
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "s3_outage_recovers",
|
||||
"level": 3,
|
||||
"window": "transient error with retry",
|
||||
"seconds": 14.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850a-a267-7089-8d90-45cb5c521022",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1850a-a26f-7791-88a6-29a9fa3d3aa4",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "retry_exhausted",
|
||||
"level": 3,
|
||||
"window": "transient error until JOB_MAX_ATTEMPTS",
|
||||
"seconds": 20.4,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850a-e8d8-7122-ab63-13e85b328efe",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1850a-e911-75b4-a3aa-7fd609efefa6",
|
||||
"pipeline_version": 1,
|
||||
"status": "failed",
|
||||
"attempt": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "image_matrix",
|
||||
"level": 4,
|
||||
"window": "limits and variants",
|
||||
"seconds": 12.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"images": [
|
||||
{
|
||||
"file": "png-rgb-320x200.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-rgba-300x300.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-palette-trns-200x100.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-gray-17x1000.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-gray-alpha-640x480.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-gray16-300x200.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-rgba16-64x64.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-1x1.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-wide-3000x2.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-small-50x30.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-rgb-1000x750.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-gray-801x601.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-cmyk-400x300.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-exif6-400x200.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-exif3-300x200.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "jpeg-rgb-4000x3000.jpg",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-exactly-10mib.png",
|
||||
"http": 202,
|
||||
"status": "ready",
|
||||
"error_code": null,
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "png-over-10mib.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-over-pixels-8001x5000.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "jpeg-over-pixels-10000x5000.jpg",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-truncated.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-corrupt-idat.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "jpeg-truncated.jpg",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "png-zero-width.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "not-an-image.png",
|
||||
"http": "rejected"
|
||||
},
|
||||
{
|
||||
"file": "gif-declared-as-png.png",
|
||||
"http": "rejected"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_commit_publish",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before publish",
|
||||
"seconds": 17.5,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850b-7437-7757-92f0-862b8e3e430c",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": false,
|
||||
"status": "queued"
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1850b-7437-7757-92f0-862b8e3e430c/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1850b-7437-7757-92f0-862b8e3e430c/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1850b-7437-7757-92f0-862b8e3e430c/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_publish_confirm",
|
||||
"level": 4,
|
||||
"window": "after publish, before confirm",
|
||||
"seconds": 15.7,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850b-acca-750e-8e22-5af17f32c47d",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"outbox_published": [
|
||||
false
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1850b-acca-750e-8e22-5af17f32c47d/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1850b-acca-750e-8e22-5af17f32c47d/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1850b-acca-750e-8e22-5af17f32c47d/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
"enqueued",
|
||||
"claimed",
|
||||
"done",
|
||||
"duplicate_noop"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_s3_before_commit",
|
||||
"level": 4,
|
||||
"window": "after S3 write, before COMMIT",
|
||||
"seconds": 23.1,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850b-f488-7792-be43-3371a5179dda",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "processing",
|
||||
"variant_rows": 0
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1850b-f488-7792-be43-3371a5179dda/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1850b-f488-7792-be43-3371a5179dda/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1850b-f488-7792-be43-3371a5179dda/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"level": 4,
|
||||
"window": "after COMMIT, before ack",
|
||||
"seconds": 17.5,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850c-4e58-7510-a23a-f8ddb2214d77",
|
||||
"exit_code": 137,
|
||||
"after_crash": {
|
||||
"status": "ready",
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1850c-4e58-7510-a23a-f8ddb2214d77/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1850c-4e58-7510-a23a-f8ddb2214d77/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1850c-4e58-7510-a23a-f8ddb2214d77/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
],
|
||||
"queues": {
|
||||
"attachments.process": [
|
||||
0,
|
||||
1
|
||||
],
|
||||
"attachments.process.dlq": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "crop",
|
||||
"sha256": "97bf1400b30a28c19420a30161c944f57b5e7d613533b76afe6ab2531cba0143",
|
||||
"size_bytes": 1820,
|
||||
"object_key": "variants/01a1850c-4e58-7510-a23a-f8ddb2214d77/1/crop-97bf1400b30a28c1.jpg"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "optimized",
|
||||
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
|
||||
"size_bytes": 2462,
|
||||
"object_key": "variants/01a1850c-4e58-7510-a23a-f8ddb2214d77/1/optimized-1090d84ed8411226.webp"
|
||||
},
|
||||
{
|
||||
"pipeline_version": 1,
|
||||
"name": "thumbnail",
|
||||
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
|
||||
"size_bytes": 4679,
|
||||
"object_key": "variants/01a1850c-4e58-7510-a23a-f8ddb2214d77/1/thumbnail-7bc40bf315c8e18e.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lease_expiry_fencing",
|
||||
"level": 4,
|
||||
"window": "stalled worker, lease expiry",
|
||||
"seconds": 40.0,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850c-936d-7519-bba4-0322f1a3c0b8",
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1850c-9377-74d0-a5d9-48ed6ed9d65c",
|
||||
"pipeline_version": 1,
|
||||
"status": "done",
|
||||
"attempt": 2
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "lease_expired",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "fenced",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "replay_failed",
|
||||
"level": 4,
|
||||
"window": "operator replay",
|
||||
"seconds": 44.6,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850d-2be1-778f-8538-077b3e53d322",
|
||||
"replay": {
|
||||
"result": "replayed",
|
||||
"attachment_id": "01a1850d-2be1-778f-8538-077b3e53d322",
|
||||
"operator": "cli"
|
||||
},
|
||||
"replay_of_ready": {
|
||||
"result": "noop",
|
||||
"attachment_id": "01a1850d-2be1-778f-8538-077b3e53d322",
|
||||
"operator": "cli"
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"kind": "enqueued",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 2
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 3
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 3
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 4
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 4
|
||||
},
|
||||
{
|
||||
"kind": "retry_scheduled",
|
||||
"attempt": 5
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 5
|
||||
},
|
||||
{
|
||||
"kind": "failed",
|
||||
"attempt": 5
|
||||
},
|
||||
{
|
||||
"kind": "replayed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "claimed",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "done",
|
||||
"attempt": 1
|
||||
},
|
||||
{
|
||||
"kind": "replay_noop",
|
||||
"attempt": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "malformed_message_dead_lettered",
|
||||
"level": 4,
|
||||
"window": "message that is not a job goes to the DLQ",
|
||||
"seconds": 7.3,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"dead_letters": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "worker_limits",
|
||||
"level": 4,
|
||||
"window": "render time and memory limits, 40 Mpx in the worker limit",
|
||||
"seconds": 27.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"image": {
|
||||
"file": "png-at-pixel-limit-8000x5000.png",
|
||||
"bytes": 116714,
|
||||
"pixels": 40000000
|
||||
},
|
||||
"render_timeout": {
|
||||
"seconds": 0.5,
|
||||
"attachment_id": "01a1850e-0649-7516-bedf-76fcced46675",
|
||||
"error_code": "processing_failed",
|
||||
"worker": "running"
|
||||
},
|
||||
"render_memory": {
|
||||
"mib": 200,
|
||||
"attachment_id": "01a1850e-2203-76ad-94a5-d96a067b88d6",
|
||||
"error_code": "processing_failed",
|
||||
"worker": "running"
|
||||
},
|
||||
"default_limits": {
|
||||
"attachment_id": "01a1850e-3e3d-75c8-b892-9a107c43d4b6",
|
||||
"variants": [
|
||||
"crop",
|
||||
"optimized",
|
||||
"thumbnail"
|
||||
],
|
||||
"memory_peak_mib": 378.8,
|
||||
"memory_max_mib": 1024.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "retry_backoff_jitter",
|
||||
"level": 4,
|
||||
"window": "backoff with equal jitter between attempts",
|
||||
"seconds": 35.2,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850e-85dc-7779-9d26-df88e9a5fe8b",
|
||||
"delays": [
|
||||
{
|
||||
"attempt": 2,
|
||||
"delay": 0.694765
|
||||
},
|
||||
{
|
||||
"attempt": 3,
|
||||
"delay": 1.738794
|
||||
},
|
||||
{
|
||||
"attempt": 4,
|
||||
"delay": 2.834139
|
||||
},
|
||||
{
|
||||
"attempt": 5,
|
||||
"delay": 7.550992
|
||||
}
|
||||
],
|
||||
"share_of_ceiling": [
|
||||
0.695,
|
||||
0.869,
|
||||
0.709,
|
||||
0.944
|
||||
],
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "01a1850e-8623-7161-af00-316420cb53db",
|
||||
"pipeline_version": 1,
|
||||
"status": "failed",
|
||||
"attempt": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "failed_retention",
|
||||
"level": 4,
|
||||
"window": "failed staging kept until retention, then replay expires",
|
||||
"seconds": 41.8,
|
||||
"result": "PASS",
|
||||
"observed": {
|
||||
"attachment_id": "01a1850e-f5b0-731a-b6a5-e50c724f4f69",
|
||||
"staging_before": "kept",
|
||||
"replay": {
|
||||
"result": "expired",
|
||||
"attachment_id": "01a1850e-f5b0-731a-b6a5-e50c724f4f69",
|
||||
"operator": "cli"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"result": "PASS",
|
||||
"finished_at": "2026-10-29T00:29:20.963570Z"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
date: 2026-10-29T00:34:02Z
|
||||
$ docker compose --profile bench --profile tools config --format json (declared)
|
||||
service cpus/mem ports secrets volumes networks ro
|
||||
-------- ---------- ------------------------------- ----------------------------------------------------------------------------------------------------------------------- ----------- ---------------------- -----
|
||||
api 1/512MiB - cache_url,cursor_secret,database_url,s3_access_key_id,s3_secret_access_key - backend(internal) true
|
||||
broker 1/512MiB 127.0.0.1:25672 rabbitmq_ops_password,rabbitmq_users broker-data backend(internal),edge true
|
||||
k6 2/512MiB - - - edge false
|
||||
lb 1/128MiB 127.0.0.1:18085,127.0.0.1:25085 - - backend(internal),edge true
|
||||
migrate 0.5/256MiB - database_url - backend(internal) false
|
||||
postgres 2/1024MiB - postgres_password pgdata backend(internal) false
|
||||
relay 0.5/192MiB - broker_url_api,database_url,s3_access_key_id,s3_secret_access_key - backend(internal) true
|
||||
s3 1/512MiB - s3_root_password,s3_root_user s3data backend(internal) true
|
||||
s3-cli 0.5/64MiB - s3_access_key_id,s3_root_password,s3_root_user,s3_secret_access_key,s3_worker_access_key_id,s3_worker_secret_access_key - backend(internal) true
|
||||
s3-init 0.5/64MiB - s3_access_key_id,s3_root_password,s3_root_user,s3_secret_access_key,s3_worker_access_key_id,s3_worker_secret_access_key - backend(internal) true
|
||||
valkey 0.5/128MiB - valkey.conf valkeydata backend(internal) false
|
||||
worker 2/1024MiB - broker_url_worker,database_url,s3_worker_access_key_id,s3_worker_secret_access_key - backend(internal) true
|
||||
|
||||
$ docker inspect (running containers: hostname = X-Instance-Id, applied limits)
|
||||
service hostname cpus memory published
|
||||
-------- ------------ ---- ------- ---------------------------------------------------
|
||||
api 095cb9cc85bd 1 512MiB
|
||||
api 70cfba801128 1 512MiB
|
||||
broker broker 1 512MiB 127.0.0.1:25672->15672/tcp
|
||||
lb c0fb1baf1003 1 128MiB 127.0.0.1:18085->8080/tcp,127.0.0.1:25085->8404/tcp
|
||||
postgres 0a58a30d4f0f 2 1024MiB
|
||||
relay 36f8b7c0afb7 0.5 192MiB
|
||||
s3 bed02ee8e4fc 1 512MiB
|
||||
valkey 1d3e7af5a234 0.5 128MiB
|
||||
worker 56c0ce59c97a 2 1024MiB
|
||||
|
||||
PASS: limits, ports, secrets, volumes and networks match the policy
|
||||
@@ -0,0 +1,68 @@
|
||||
date: 2026-10-29T00:32:35Z commit: 0b85edf
|
||||
# ID — вложение, доведённое до failed retry_exhausted: pipeline_suite.py --only retry_exhausted
|
||||
$ make failed # реестр failed-заданий (последние 20), последняя строка — JSON; первые три записи
|
||||
[
|
||||
{
|
||||
"job_id": "01a18512-1b5f-75e8-afc5-4d8de5a1fd37",
|
||||
"attachment_id": "01a18512-1b35-7151-b14a-b65248339365",
|
||||
"pipeline_version": 1,
|
||||
"attempt": 5,
|
||||
"error_code": "retry_exhausted",
|
||||
"last_error": "Unavailable",
|
||||
"failed_at": "2026-10-29T00:32:12.404490+00:00"
|
||||
},
|
||||
{
|
||||
"job_id": "01a1850e-f5c8-74cf-bb11-17f5660ff7cb",
|
||||
"attachment_id": "01a1850e-f5b0-731a-b6a5-e50c724f4f69",
|
||||
"pipeline_version": 1,
|
||||
"attempt": 5,
|
||||
"error_code": "retry_exhausted",
|
||||
"last_error": "Unavailable",
|
||||
"failed_at": "2026-10-29T00:28:43.569198+00:00"
|
||||
},
|
||||
{
|
||||
"job_id": "01a1850e-8623-7161-af00-316420cb53db",
|
||||
"attachment_id": "01a1850e-85dc-7779-9d26-df88e9a5fe8b",
|
||||
"pipeline_version": 1,
|
||||
"attempt": 5,
|
||||
"error_code": "retry_exhausted",
|
||||
"last_error": "Unavailable",
|
||||
"failed_at": "2026-10-29T00:28:18.113299+00:00"
|
||||
}
|
||||
]
|
||||
... всего 13
|
||||
$ make replay ID=01a18512-1b35-7151-b14a-b65248339365
|
||||
{"result": "replayed", "attachment_id": "01a18512-1b35-7151-b14a-b65248339365", "operator": "cli"}
|
||||
$ psql: состояние вложения и задания через 6 с
|
||||
status | error_code | job_id | job_status | attempt | staging_removed
|
||||
--------+------------+--------------------------------------+------------+---------+-----------------
|
||||
ready | | 01a18512-1b5f-75e8-afc5-4d8de5a1fd37 | done | 1 | t
|
||||
(1 row)
|
||||
|
||||
$ make replay ID=01a18512-1b35-7151-b14a-b65248339365 # повтор для ready
|
||||
{"result": "noop", "attachment_id": "01a18512-1b35-7151-b14a-b65248339365", "operator": "cli"}
|
||||
$ psql: SELECT kind, attempt, detail FROM job_events WHERE attachment_id = ID ORDER BY id
|
||||
kind | attempt | detail
|
||||
-----------------+---------+------------------------------------------------------------------------------------------------------------
|
||||
enqueued | 1 | {}
|
||||
claimed | 1 | {}
|
||||
retry_scheduled | 2 | {"error": "Unavailable", "delay_seconds": 0.554707, "next_attempt_at": "2026-10-29T00:32:00.190332+00:00"}
|
||||
claimed | 2 | {}
|
||||
retry_scheduled | 3 | {"error": "Unavailable", "delay_seconds": 1.70871, "next_attempt_at": "2026-10-29T00:32:05.029872+00:00"}
|
||||
claimed | 3 | {}
|
||||
retry_scheduled | 4 | {"error": "Unavailable", "delay_seconds": 2.197943, "next_attempt_at": "2026-10-29T00:32:07.534942+00:00"}
|
||||
claimed | 4 | {}
|
||||
retry_scheduled | 5 | {"error": "Unavailable", "delay_seconds": 4.2547, "next_attempt_at": "2026-10-29T00:32:12.125315+00:00"}
|
||||
claimed | 5 | {}
|
||||
failed | 5 | {"error": "Unavailable", "error_code": "retry_exhausted"}
|
||||
replayed | 1 | {"operator": "cli", "error_code": "retry_exhausted"}
|
||||
claimed | 1 | {}
|
||||
done | 1 | {}
|
||||
replay_noop | 1 | {"result": "noop", "operator": "cli"}
|
||||
(15 rows)
|
||||
|
||||
$ make replay ID=01a1850a-e8d8-7122-ab63-13e85b328efe # failed, staging удалён по retention (сценарий failed_retention)
|
||||
{"result": "expired", "attachment_id": "01a1850a-e8d8-7122-ab63-13e85b328efe", "operator": "cli"}
|
||||
$ make dlq # DLQ без извлечения (ack_requeue_true)
|
||||
71 true attachments.dlx attachment.process.v1 1 content_type: "application/json",delivery_mode: 2,headers: {"x-death":[{"count":1,"exchange":"attachments","queue":"attachments.process","reason":"rejected","routing-keys":["attachment.process.v1"],"time":1793233047}],"x-delivery-count":2,"x-first-death-exchange":"attachments","x-first-death-queue":"attachments.process","x-first-death-reason":"rejected","x-last-death-exchange":"attachments","x-last-death-queue":"attachments.process","x-last-death-reason":"rejected"},message_id: "63d240e5-f57d-485b-9cc7-32b477a90248",type: "attachment.process.v1", {"schema_version": 2, "job_id": "63d240e5-f57d-485b-9cc7-32b477a90248"} string
|
||||
71 true attachments.dlx attachment.process.v1 0 content_type: "application/json",delivery_mode: 2,headers: {"x-death":[{"count":1,"exchange":"attachments","queue":"attachments.process","reason":"rejected","routing-keys":["attachment.process.v1"],"time":1793233636}],"x-delivery-count":1,"x-first-death-exchange":"attachments","x-first-death-queue":"attachments.process","x-first-death-reason":"rejected","x-last-death-exchange":"attachments","x-last-death-queue":"attachments.process","x-last-death-reason":"rejected"},message_id: "c9c23d22-98a8-40ab-a151-279a330433c9",type: "attachment.process.v1", {"schema_version": 2, "job_id": "c9c23d22-98a8-40ab-a151-279a330433c9"} string
|
||||
@@ -0,0 +1,28 @@
|
||||
date: 2026-10-29T00:32:58Z commit: 0b85edf
|
||||
== before: service hostname StartedAt status
|
||||
api 095cb9cc85bd 2026-10-29T00:23:26.937801097Z running
|
||||
api 70cfba801128 2026-10-29T00:23:26.872290805Z running
|
||||
broker broker 2026-10-29T00:23:33.239099711Z running
|
||||
lb c0fb1baf1003 2026-10-29T00:14:15.16099305Z running
|
||||
migrate cd1e567cebc2 2026-10-29T00:20:55.26042818Z exited
|
||||
postgres 0a58a30d4f0f 2026-10-29T00:14:15.17657905Z running
|
||||
relay 36f8b7c0afb7 2026-10-29T00:32:29.769448Z running
|
||||
s3 bed02ee8e4fc 2026-10-29T00:23:57.327718375Z running
|
||||
s3-init 0fd32e62264c 2026-10-29T00:20:55.264511638Z exited
|
||||
valkey 1d3e7af5a234 2026-10-29T00:14:15.175894758Z running
|
||||
worker 56c0ce59c97a 2026-10-29T00:32:29.771418417Z running
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:18085"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
== after: service hostname StartedAt status
|
||||
api 095cb9cc85bd 2026-10-29T00:33:12.427394173Z running
|
||||
api 70cfba801128 2026-10-29T00:33:12.607365173Z running
|
||||
broker broker 2026-10-29T00:33:05.74921692Z running
|
||||
lb c0fb1baf1003 2026-10-29T00:33:06.709645795Z running
|
||||
migrate cd1e567cebc2 2026-10-29T00:33:10.208706213Z exited
|
||||
postgres 0a58a30d4f0f 2026-10-29T00:33:04.711349336Z running
|
||||
relay 36f8b7c0afb7 2026-10-29T00:33:22.887360136Z running
|
||||
s3 bed02ee8e4fc 2026-10-29T00:33:04.671988127Z running
|
||||
s3-init 0fd32e62264c 2026-10-29T00:33:10.223091755Z exited
|
||||
valkey 1d3e7af5a234 2026-10-29T00:33:04.747377252Z running
|
||||
worker 56c0ce59c97a 2026-10-29T00:33:22.886019136Z running
|
||||
@@ -0,0 +1,33 @@
|
||||
date: 2026-10-29T00:21:17Z
|
||||
$ docker compose stop -t 10 worker -> 0.4 s, exit code 0
|
||||
upload -> 202 status=queued id=01a18508-5393-719b-bbd5-2265c6138ccd
|
||||
GET content?variant=original while worker is stopped -> 409
|
||||
GET content?variant=thumbnail while worker is stopped -> 409
|
||||
$ rabbitmqctl list_queues -p messenger name messages_ready messages_unacknowledged
|
||||
name messages_ready messages_unacknowledged
|
||||
attachments.process 1 0
|
||||
attachments.process.dlq 1 0
|
||||
$ rabbitmqadmin get messages -q attachments.process -a ack_requeue_true
|
||||
+---------------+-------------+-------------+-----------------------+---------------+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
|
||||
| payload_bytes | redelivered | exchange | routing_key | message_count | properties | payload | payload_encoding |
|
||||
+---------------+-------------+-------------+-----------------------+---------------+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
|
||||
| 243 | false | attachments | attachment.process.v1 | 0 | app_id: "faststream-0.7.8" | {"type": "attachment.process.v1", "job_id": "01a18508-539b-7426-8b71-492a7249adcc", "attempt": 1, "created_at": "2026-10-29T00:21:17.851856Z", "attachment_id": "01a18508-5393-719b-bbd5-2265c6138ccd", "schema_version": 1, "pipeline_version": 1} | string |
|
||||
| | | | | | content_type: "application/json" | | |
|
||||
| | | | | | correlation_id: "dec88fb4-3a9e-460f-843e-3410a0e73d77" | | |
|
||||
| | | | | | delivery_mode: 2 | | |
|
||||
| | | | | | headers: {} | | |
|
||||
| | | | | | message_id: "01a18508-539b-7426-8b71-492a7249adcc" | | |
|
||||
| | | | | | priority: 0 | | |
|
||||
| | | | | | timestamp: 1793233278 | | |
|
||||
| | | | | | type: "attachment.process.v1" | | |
|
||||
| | | | | | | | |
|
||||
+---------------+-------------+-------------+-----------------------+---------------+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
|
||||
payload keys: ['attachment_id', 'attempt', 'created_at', 'job_id', 'pipeline_version', 'schema_version', 'type']
|
||||
$ docker compose stop -t 10 relay -> 0.3 s, exit code 0
|
||||
$ docker compose up -d --no-deps --wait relay -> healthy
|
||||
$ docker compose up -d --no-deps --wait worker -> healthy
|
||||
after worker start -> status=ready variants=[('crop', 128, 128), ('optimized', 320, 200), ('thumbnail', 256, 160)]
|
||||
name messages_ready messages_unacknowledged
|
||||
attachments.process 0 0
|
||||
attachments.process.dlq 1 0
|
||||
PASS: pipeline stand evidence
|
||||
@@ -0,0 +1,89 @@
|
||||
# Исправления major после первого ревью ЛР5
|
||||
|
||||
Исходный snapshot: `544b9c78d39d0e9dd07f841894c390895896605a`.
|
||||
Этап выполнялся в основном репозитории, в существующем `.venv`, без установки окружений,
|
||||
Docker, нагрузки, фоновых процессов и публикации. REPORT оформляет отдельный агент.
|
||||
|
||||
## Что исправлено
|
||||
|
||||
1. В `infra/rabbitmq/definitions.json` рабочая очередь получила `delivery-limit=-1`.
|
||||
При ошибке PostgreSQL до claim consumer продолжает delayed nack с теми же `job_id`/`attempt`;
|
||||
брокер больше не должен отправлять сообщение в DLQ по числу доставок. `JOB_MAX_ATTEMPTS=5`,
|
||||
backoff/jitter после claim, reject невалидных сообщений в DLX и ack после COMMIT сохранены.
|
||||
Поддержка политики сверена с [документацией RabbitMQ 4.1](https://www.rabbitmq.com/docs/4.1/quorum-queues#poison-message-handling)
|
||||
и [исходником RabbitMQ v4.1.8](https://github.com/rabbitmq/rabbitmq-server/blob/v4.1.8/deps/rabbit/src/rabbit_quorum_queue.erl)
|
||||
(`args_policy_lookup`, `resolve_delivery_limit`). Это проверка кода/документации, не запуск брокера.
|
||||
2. `flatten` учитывает PNG tRNS в RGB/L/1/P и точное значение 16-битного grayscale до нормализации.
|
||||
Все три варианта обеих версий имеют белые прозрачные области и сохраняют непрозрачные пиксели.
|
||||
Соседние grayscale 12345/12346 проверены отдельно, чтобы нормализация не создала ложную прозрачность.
|
||||
|
||||
## Выполненные проверки
|
||||
|
||||
| Команда | Наблюдение | Файл |
|
||||
| --- | --- | --- |
|
||||
| `PYTHONPATH=src:student-tests .venv/bin/python -m pytest --confcutdir=student-tests/unit student-tests/unit/test_renderer.py student-tests/unit/test_worker_delivery.py -q --tb=short` до исправления | 9 failed, 25 passed: RGB/L/1/16-bit и delivery-limit | `regressions-before.txt` |
|
||||
| Та же команда с добавлением `student-tests/unit/test_pipeline_domain.py` после первого исправления | 2 failed, 55 passed: ошибка 16-битной тестовой fixture, см. ниже | `regressions-fixture-error.txt` |
|
||||
| `PYTHONPATH=src:student-tests .venv/bin/python -m pytest --confcutdir=student-tests/unit student-tests/unit/test_renderer.py student-tests/unit/test_worker_delivery.py student-tests/unit/test_pipeline_domain.py -q --tb=short` после исправления fixture | 57 passed, без загрузки общего conftest | `regressions-after.txt` |
|
||||
| `PYTHONPATH=src:student-tests .venv/bin/python -m pytest --noconftest student-tests/api/test_bounded_contexts.py -q --tb=short` | 20 passed: зоны, транспорт, SQLAlchemy | `boundaries.txt` |
|
||||
| `make check` | PASS, приложение не тестировалось | `check.txt` |
|
||||
| `make validate` | PASS OpenAPI/JSON Schema | `validate.txt` |
|
||||
| `make lint` | PASS ruff check/format и ty | `lint.txt` |
|
||||
| `openspec validate --all --strict` до архивации | 23 passed, 0 failed | `openspec.txt` |
|
||||
| `git diff --check` | exit 0 | `diff.txt` |
|
||||
|
||||
В offline consumer-тесте 12 ошибок приводят к 12 nack и нулю ack/reject, затем успешный
|
||||
bus-вызов даёт один ack; все 13 вызовов получают одно и то же задание. Пауза заменена AsyncMock.
|
||||
Это не моделирует сервер RabbitMQ, реальное подключение к БД или COMMIT.
|
||||
|
||||
Промежуточная fixture создавала правую половину `I;16` через `paste(12346, box)`, получая
|
||||
14906 из-за семантики Pillow для скалярной заливки. Заменена на вставку `Image.new('I;16', …, 12346)`
|
||||
с явной проверкой исходного пикселя. Производственный код для исправления этого теста не менялся.
|
||||
Неуспешные логи сохранены и не считаются PASS.
|
||||
|
||||
Дополнительно в одном offline Python-процессе исходный модуль из
|
||||
`git show 544b9c78d39d0e9dd07f841894c390895896605a:src/messenger/attachments/infrastructure/images.py`
|
||||
загружен в отдельный `ModuleType` и сопоставлен с текущим `render_variants`:
|
||||
9 fixture × 2 версии × 3 варианта = **54 побайтно одинаковых варианта**.
|
||||
Проверены sample, RGB/CMYK JPEG, RGBA/LA PNG, P с/без transparency, L и I;16 без tRNS.
|
||||
Хеши — `unchanged-rendering.json`. Это подтверждает сохранение этих путей рендера, не throughput.
|
||||
Точные SHA-256 затронутых файлов и exit codes — `checks.json`.
|
||||
|
||||
## Обязательные проверки финального агента
|
||||
|
||||
Эти проверки **НЕ запускались**. Архивация OpenSpec закрывает реализацию и offline-часть,
|
||||
а не динамическую квалификацию исправления.
|
||||
|
||||
1. На разрешённом стенде RabbitMQ **4.1.8**, с существующим volume, применить definitions без
|
||||
пересоздания очередей/удаления данных. Сохранить `rabbitmqctl list_policies -p messenger`
|
||||
и эффективную policy очереди `attachments.process`, исходную глубину DLQ. Убедиться в `delivery-limit=-1`.
|
||||
Старые сообщения, уже попавшие в DLQ, смена политики автоматически не возвращает.
|
||||
2. Выполнить `make student-test PYTEST_ARGS='student-tests/adapters/test_rabbitmq.py -q'`:
|
||||
real-broker тест теперь включает 1 и 12 инфраструктурных ошибок, ждёт завершения и проверяет,
|
||||
что DLQ не выросла. Также проверить reject невалидного сообщения, publisher confirms и права worker.
|
||||
3. Проверить полную цепочку с настоящим отказом БД: остановить worker, upload → `202 queued`,
|
||||
дождаться опубликованного outbox, остановить PostgreSQL **своего project**, запустить worker,
|
||||
получить более 10 записей `job.requeued`, восстановить PostgreSQL. Без replay получить `ready`
|
||||
с прежними `job_id`/`attempt`, одним набором вариантов, совпадающими хешами и неизменной DLQ.
|
||||
Сохранить ID, сырые логи и `docker ps -a` для фактически остановленных контейнеров.
|
||||
4. Через LB загрузить RGB/L/1/16-bit PNG с tRNS, получить `202 → ready`, проверить белые/непрозрачные
|
||||
контрольные пиксели, метаданные и хеши thumbnail/crop/optimized для pipeline v1 и v2.
|
||||
Проверить tRNS-путь на пределе 40 Мпикс под Linux с заданными лимитами памяти/времени.
|
||||
5. Повторить затронутые сценарии pipeline: invalid-message/DLQ, retry-exhaustion/replay,
|
||||
crash до/после COMMIT и ack, duplicate/reorder/lease fencing, v1/v2, инварианты single_effect,
|
||||
bounded_attempts/no_lost_202. Достаточны адресные серии suite с сохранением их команд и условий;
|
||||
прежние пригодные нагрузочные серии для изображений без tRNS этим изменением не аннулированы.
|
||||
|
||||
Имена конкретных сценариев suite доступны в `scripts/pipeline_suite.py`; перед финальным запуском
|
||||
использовать его штатные `--only`/`--output`. Прогоны public smoke/persistence/failover повторять,
|
||||
если финальный аудит найдёт отсутствующее или затронутое подтверждение; прежние данные не стирать.
|
||||
|
||||
## Ограничения для отдельного REPORT
|
||||
|
||||
Пять minor первого ревью сохранены в `findings.json`. Они не исправлялись и не блокируют следующий
|
||||
этап. В частности, `crash_publish_confirm` доказывает сбой после confirm до отметки outbox, старый
|
||||
limits exit 1 не является PASS, reconcile_track для ЛР5 непригоден, failed upgrade не повторяется
|
||||
отдельно, а спорные длительности track2 исключены из выводов о производительности.
|
||||
|
||||
Неограниченные инфраструктурные redelivery сохраняют сообщение при длительном отказе БД ценой
|
||||
повторных попыток/записей журнала; постоянные ошибки после claim остаются ограниченными.
|
||||
Для 16-битного tRNS добавляется маска 1 байт/пиксель и LUT 65536 значений; её пределы требуют Linux-прогона.
|
||||
@@ -0,0 +1,2 @@
|
||||
.................... [100%]
|
||||
20 passed in 0.15s
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"baseline_sha": "544b9c78d39d0e9dd07f841894c390895896605a",
|
||||
"checks": [
|
||||
{
|
||||
"command": [
|
||||
"make",
|
||||
"check"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"output": "check.txt"
|
||||
},
|
||||
{
|
||||
"command": [
|
||||
"make",
|
||||
"validate"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"output": "validate.txt"
|
||||
},
|
||||
{
|
||||
"command": [
|
||||
"make",
|
||||
"lint"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"output": "lint.txt"
|
||||
},
|
||||
{
|
||||
"command": [
|
||||
"openspec",
|
||||
"validate",
|
||||
"--all",
|
||||
"--strict"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"output": "openspec.txt"
|
||||
},
|
||||
{
|
||||
"command": [
|
||||
"git",
|
||||
"diff",
|
||||
"--check"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"output": "diff.txt"
|
||||
}
|
||||
],
|
||||
"sha256": {
|
||||
"src/messenger/attachments/infrastructure/images.py": "987f1e2d638412fcb4062924245314d1f16ffb8f3600c111867a5e21127f8257",
|
||||
"infra/rabbitmq/definitions.json": "91c430622ed4f4d9c446d9c81b70d1b431fbad87c18b3dedd1feb34454d4b2a8",
|
||||
"student-tests/unit/test_worker_delivery.py": "3b14dfbc40ca704c67b6f18bba37045dfeab1f45447ec89655e1f260ff33c2d1",
|
||||
"student-tests/unit/test_renderer.py": "4c70ee4fac2b7430d21682d05e5381b4867f522cec5b764c92c781d9d9e78a92",
|
||||
"student-tests/adapters/test_rabbitmq.py": "d18b135dc387077d9e165169a1b04050c9241349a7bafc2cd92fdf3227593def"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
[
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "src/messenger/attachments/application/pipeline.py:230",
|
||||
"problem": "Сохранено из ревью 544b9c78d39d0e9dd07f841894c390895896605a: after_publish_before_confirm вызывается после publish(), уже проверившего Basic.Ack. crash_publish_confirm доказывает сбой после confirm до COMMIT outbox, а не потерю подтверждения."
|
||||
},
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "scripts/limits.py:10",
|
||||
"problem": "Сохранено из первого ревью: S3_CLIENT_SECRETS не отсортирован, сравнение с sorted(secrets) даёт ложные FAIL. evidence/sqlalchemy-2026-11-06/grade3/limits.txt содержит exit_code=1; этот запуск нельзя обозначать PASS."
|
||||
},
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "scripts/reconcile_track.py:396",
|
||||
"problem": "Сохранено из первого ревью: демонстратор ожидает upload 201 и attachments/, поэтому непригоден для квалификации ЛР5 с 202 queued. Текущие pipeline evidence его не используют."
|
||||
},
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "src/messenger/attachments/application/pipeline.py:333",
|
||||
"problem": "Сохранено из первого ревью: failed upgrade v2 при опубликованной ready v1 нельзя отдельно повторить через replay/reprocess. V1 остаётся доступной; подтверждение исходного ревью — test_failed_new_version_keeps_ready_original."
|
||||
},
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "evidence/forward-final-2026-11-06/clock-observation.json",
|
||||
"problem": "Сохранено из первого ревью: в повторах 2/3 UTC-интервалы расходятся с elapsed (1161.195/186.458 с и 571.513/180.259 с). Причина не установлена; длительности исключены из выводов о производительности."
|
||||
}
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user