PIP-001 — Process Improvement Proposals (PSP × OpenUP × Agent)

# PIP-001 — Process Improvement Proposals
Baseline process: **PSP0.1 within OpenUP, agent-assisted (Kilo)**. v0.4, 2026-09-18.

## Purpose
This note collects **process-level improvements only**. Product/work-package specifics (features, defects, schedules) live in the project tracker and project notebooks; this note defines *how we work*. Each cycle's postmortem appends/updates proposals here.

## A. Improvement proposals
| # | Problem (observed) | Process improvement | Applies to |
|---|---|---|---|
| A1 | Phase times had to be reconstructed post-hoc from artifacts (DB timestamps, reports, chat evidence) | The agent maintains the PSP Time- and Defect-Recording logs as a by-product: write session start/end and phase transitions into the cycle log at every gate and phase switch. Also record the cycle's **size-counting exclusions** (e.g. investigation tooling) at planning time | PSP × Agent |
| A2 | rustfmt gate missed new `examples/` directories (recurred twice in one cycle) | One workspace-level gate entry point: `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace` — never per-package or per-target gates | OpenUP gate |
| A3 | Rich audit/evidence logging enabled byte-level root-cause analysis after the fact | Keep evidence-rich logging as standard; pair it with a defined **redaction policy** (secret material removed per build variant) so evidence stays usable *and* safe | OpenUP + Security |
| A4 | Defective data from an external/supplier source surfaced as deep integration failures far from the boundary | Define **integration-boundary preflight validation**: incoming external data is checked at the boundary (fail fast, clear message) before deep processing | OpenUP (supplier mgmt) |
| A5 | Latent O(N) queries in a persistence layer surfaced only via a scaled stress test (10× projected lifetime volume) | Add **persistence stress at 10× projected lifetime volume** to the Definition of Done for storage/schema features; keep a reusable stress/bench toolset in the repo | OpenUP DoD |
| A6 | Agent permission profile flapped mid-cycle; allow-listed commands were intermittently denied, stalling phase work | Pin a stable project permission profile (project config) covering gate, bench, and VCS commands **before** the cycle starts | Agent |
| A7 | Reusable analysis scripts were left outside the repository | Bench/stress/tooling scripts belong in the repository (`tools/` or `scripts/`) so the methodology survives the cycle | Agent + Reuse |
| A8 | A design decision drifted through multiple unverified theories before a live capture settled it | Record design decisions **with a verification step** (bench capture/measurement) in the same cycle they are made; keep a decision-log entry with an evidence link | PSP |
| A9 | Ad-hoc LOC counts (raw lines, partial scopes) disagreed with the PSP form during the postmortem | Size is **always** counted with the committed standard: `python scripts/count-loc.py <base-ref> <final-ref>` (counting rule documented in the script header; scope = all `.rs`+`.toml` under `crates/` incl. tests/examples/manifests). Cycle-specific exclusions are subtracted transparently and noted on the form | PSP × Agent |
| A10 | "New Reusable" size judgments were ad hoc (0 vs 781 debated in the postmortem) | **Reuse test** — count LOC as *New Reusable* only if **all** hold: (1) domain-free (no product AIDs, REL semantics, serial formats, product config), (2) documented + tested so it works as-is, (3) a *named* future reuser exists in the product family, (4) reusable **unmodified**. Until then report `0` and list the files as *reuse candidates*; when a later cycle actually reuses them unmodified, it counts them as **Reused (R)** in that cycle's form | PSP |

## B. Process definition — PSP × OpenUP × Agent
| PSP phase | OpenUP discipline / artifact | Agent role | Gate |
|---|---|---|---|
| Planning | Inception: requirements, test-case list | Draft requirements/scripts, issue texts, PSP0.1 estimates; record base ref + exclusions | Model exports + test-case doc regenerated |
| Design | Elaboration: architecture model, UC realizations | Doc-script generation + consistency fixes; decision log with evidence | Architecture notebook + exporter gates |
| Code | Construction: implementation + defect-log upkeep | Implement; maintain Time/Defect logs; run gates | `cargo fmt --all --check`; `cargo clippy --workspace --all-targets -- -D warnings`; `cargo test --workspace` |
| Compile | Variant gates (full/test/prod) | Variant builds; cfg-gated redaction checks | Variant gate |
| Test | Bench campaigns + scaled stress | Run bench, capture traces, byte-compare evidence, generate/measure stress DBs | Test report (generate-test-report.py) |
| Postmortem | PIP + Project Plan Summary | Compute size/time from git/DB evidence (`scripts/count-loc.py <base> <final>`); apply the A10 reuse test; draft PIP | This note updated |

## C. Lessons learned (process-level)
- Evidence-first logging turns disputes into proofs.
- A control run (known-good path on the same target) isolates external data defects fastest.
- Agent-assisted phases compress documentation and tooling work substantially — given stable permissions and one fixed gate entry point.
- Post-hoc reconstruction of metrics from artifacts works, but live logging avoids the effort entirely.


id: 0d58652c6ce94c45b775bf5ee3afb31c
parent_id: 8b5fa4e428aa45cea7ff177c47be20d4
created_time: 2026-09-18T12:06:28.268Z
updated_time: 2026-09-18T12:48:45.712Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author: 
source_url: 
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data: 
order: 1789733188269
user_created_time: 2026-09-18T12:06:28.268Z
user_updated_time: 2026-09-18T12:48:45.712Z
encryption_cipher_text: 
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id: 
conflict_original_id: 
master_key_id: 
user_data: 
deleted_time: 0
is_locked: 0
extracted_resource_ids: 
type_: 1