BOHICA-LABS / BOHICA-LABS/vsdd-factory
feat(workflows): revalidate deferred items with research-agent before pulling them into active work
- Dominant language
- Rust
- Stars
- 2
- Forks
- 1
- Avg merge
- 6h 43m
- Merged PRs (30d)
- 29
Description
## Summary
When a **deferred item** is later pulled into active work, the pipeline starts implementing it without first **revalidating that it's still a valid thing to work on**. Items get deferred with a snapshot of context (a Phase 5/6 finding, a backlog idea, a blocked requirement), then resurface weeks or cycles later and go straight into spec/implementation — with no step that asks "is this still relevant, or has it been superseded / fixed elsewhere / made obsolete by a dependency or landscape change?"
I'd like a **research-agent revalidation gate** that fires at the moment a deferred item transitions to active work, returning a STILL-VALID / OBSOLETE verdict (with evidence) before any spec or code work begins.
## What counts as a "deferred item"
Deferral surfaces I found in `1.0.0-rc.20`:
| Surface | Where | Notes |
|---|---|---|
| Tech-debt register (TD-NNN, P0/P1/P2) | `.factory/tech-debt-register.md` (`templates/tech-debt-register-template.md`) | Sourced from deferred Phase 5/6 findings, spec drift, CVEs, etc. P0s accumulate into a refactor cycle. |
| Blocking Issues | `STATE.md` (`templates/state-template.md`) | Resolved → archived; no revalidation documented. |
| Skip Log | `STATE.md` | Deferred/skipped phases. |
| GAP register (GAP-NNN) | story decomposition (`docs/FACTORY.md`) | Requirements deferred to a later version. |
| Discovery ideas | discovery backlog (`agents/orchestrator/discovery-sequence.md`) | Deferred with a cooldown period. |
| Product backlog / feature requests | `STATE.md` `## Product Backlog` (`agents/orchestrator/steady-state.md`) | Human-prioritized; can sit for multiple cycles. |
## Where research validation happens today — and where it doesn't
**research-agent IS invoked at:**
- Greenfield Phase 1 — domain + market landscape research (`agents/orchestrator/greenfield-sequence.md`).
- Discovery idea scoring — fresh research before ideas are scored (`agents/orchestrator/discovery-sequence.md`).
- Feature-mode **Market Intelligence** step — `business-analyst + research-agent`, "skip for bug fixes" (`agents/orchestrator/feature-sequence.md`).
**research-agent is NOT invoked on the deferred-item-pickup paths:**
- `agents/orchestrator/maintenance-sequence.md` — **0** research-agent calls. Maintenance sweep findings (the main tech-debt source) are classified automated-fix vs manual-fix and routed straight to fix-PR delivery. The only "staleness" checks there are about API docs and holdout scenarios, not about whether the debt item itself is still worth fixing.
- `agents/orchestrator/feature-sequence.md` — the single research-agent call is the generic Market Intelligence step. It is **not conditioned on whether the item was deferred** or how long ago, and it is **skipped entirely for bug fixes**. So a TD-NNN flagged months ago, or a feature backlogged for several cycles, enters Phase F1 → implementation with no "is this still valid?" check.
Net: research validation is applied at **initial planning** but **skipped when resurrecting deferred work**. The deferred context is treated as evergreen.
## Why this matters
- A Phase 5/6 deferred finding may already be fixed by unrelated refactors, or rendered moot by a dependency upgrade — implementing it wastes a cycle.
- A long-backlogged feature may be superseded by a competitor/library/platform change the team hasn't re-checked.
- A deferred discovery idea past its cooldown re-enters automatically, but a manually-backlogged item never gets that re-research.
- The cost of a stale pickup is high: full VSDD rigor (specs, tests, adversarial review) spent on work that should have been re-deferred or dropped.
## Proposal: deferred-item revalidation gate
At the transition **deferred → active work**, before any spec/implementation, spawn `research-agent` to revalidate, then surface the verdict to the human.
Suggested prompt shape:
> "This item was deferred on `` (source: ``). Revalidate whether it is still worth working on:
> 1. Has the market/competitive landscape shifted since deferral?
> 2. Have dependencies, platform, or available libraries changed (is there now a better/built-in solution)?
> 3. Has the underlying problem been resolved or made moot by other work?
> 4. Have user/product needs evolved?
> Return **STILL-VALID** (proceed) or **OBSOLETE/SUPERSEDED** (recommend re-defer or drop), with cited evidence."
On `OBSOLETE/SUPERSEDED` → route to human decision (re-defer / drop / replace) instead of auto-proceeding.
### Natural insertion points
1. **Feature-sequence (primary):** add a "Deferred-Item Revalidation" pre-step before Market Intelligence in `agents/orchestrator/feature-sequence.md`, gated on `item.deferred == true` (or age threshold). Critically, it should **also run for bug fixes** if the item was deferred, since Market Intelligence is skipped for those.
2. **Maintenance → refactor cycle:** revalidate P0 tech-debt items in `agents/orchestrator/maintenance-sequence.md` (or `skills/track-debt`) before they're promoted into a refactor cycle, rather than only when/if a human later selects the cycle.
3. **Discovery cooldown lift:** when a deferred idea reaches end of cooldown, attach an explicit "has the landscape changed since deferral?" research sub-task (`agents/orchestrator/discovery-sequence.md`).
### Make it cheap / avoid friction
- Trigger only when the item is actually deferred (and optionally only past an age threshold, e.g. >30 days or >1 cycle) — fresh items skip the gate.
- One scoped research call per item; reuse the existing research-cache where possible.
- Record the verdict + date on the item (e.g. a `last_revalidated` field on TD/GAP records) so repeated pickups within a window don't re-research.
## Acceptance criteria (draft)
- [ ] Pulling a deferred item (tech-debt, GAP, blocked-then-unblocked, or backlog item past threshold) into active work triggers a research-agent revalidation **before** spec/implementation work begins.
- [ ] The gate runs even for bug-fix-type work when the item was deferred (not gated behind Market Intelligence, which skips bug fixes).
- [ ] A STILL-VALID verdict proceeds; an OBSOLETE/SUPERSEDED verdict routes to an explicit human decision (re-defer / drop / replace) and is logged.
- [ ] Verdict + date recorded on the item so pickups within a configurable window don't re-research.
- [ ] Fresh (non-deferred) items are unaffected — no new friction on the normal greenfield/feature path.
- [ ] Tech-debt items promoted to a refactor cycle are revalidated at promotion, not only at eventual human selection.
## Open questions
- Age/cycle threshold for triggering revalidation (always vs. >30 days vs. >N cycles)?
- Should revalidation be automatic at pickup, or always require a human "proceed" on the verdict?
- Per-surface scope: include Blocking Issues and Skip Log entries, or limit to tech-debt / GAP / backlog items?
---
*Filed after tracing deferred-item handling vs. research-agent invocation in `vsdd-factory@1.0.0-rc.20`. Happy to prototype the feature-sequence gate first if the approach is agreed.*
Contributor guide
Assessment
This issue has not been assessed yet.