Harness Intelligence Wiki
SpecsCLIHuman Backlog

Human Backlog

Spec: Human Backlog

Context

Business requesters and product owners at a client track business requests and release status in the client's Azure DevOps project, the Human Backlog. They do not read the Core Backlog (Linear or GitHub, written only by write-backlog). Giovanni's five Azure DevOps skills and his ado.py helper work today for one client only (org, project and tenant are fixed).

This spec makes those skills generic, ships them from ci-app as @collective-intelligence/backlog, installs them in HI repos through the ci-solutions Pack, adds the humanBacklog setting, adds setup-human-backlog with an Eject for clients, and lets write-backlog write the late Human States from Core Backlog delivery evidence.

Canonical terms: Human Backlog Glossary. Decision trail: grill log. Design: architecture.

Human StateWriterTrigger
Receivedcreate-business-requestitem created (initial state)
In analysisanalyze-business-requestfirst Feature link
Plannedplan-sprintfirst linked Feature gets a sprint
In progresswrite-backlogfirst work-started fact in the Fog scope
On stagingwrite-backlogstaging evidence for every Story and Task
Livewrite-backlogFog completes (production evidence)
Rejecteda person, or update-business-request on requestbusiness decision
Withdrawna person, update-business-request on request, or write-backlog for a Cancelled Fogbusiness decision

Non-Goals

  • A delivery step that records staging or production evidence. Until one exists, only In progress is written automatically (Q19).
  • Configurable write language or sprint length (Q5, Q6).
  • Client changes to work-item types, fields or states (Q4).
  • Creating the Azure DevOps process through its API (Q37).
  • An HI-required az tool or any provider-specific HI tool (Q27).
  • Python tests run by HI (Q26).
  • Choosing the client's harness; caching, staging retirement, BI metadata, document procedures, development-side skills.

Requirements and Outcomes

OUT-001: Business Requests follow the fixed Human State lifecycle

Each Human State has the writer and trigger in the Context table. Revision eligibility of update-business-request uses the new state names.

Architecture: OUT-001 in #spec-traceability; ARC-001, FLOW-001.

OUT-002: Automated Human State writes are forward-only and safe to repeat

ado.py set-state is the only automated way to change a Business Request state.

Architecture: OUT-002 in #spec-traceability; ARC-003, Models.

OUT-003: write-backlog writes late Human States from Core Backlog evidence

When humanBacklog is configured and a Fog links a Business Request, write-backlog writes In progress, On staging, Live, and Withdrawn for a Cancelled Fog. A Human Backlog problem never blocks delivery.

Architecture: OUT-003 in #spec-traceability; ARC-006, FLOW-002.

Architecture: OUT-004 in #spec-traceability; ARC-008.

OUT-005: The Human Backlog skills and ado.py work for any client

Architecture: OUT-005 in #spec-traceability; ARC-003, FLOW-005.

OUT-006: ci-app publishes @collective-intelligence/backlog

Architecture: OUT-006 in #spec-traceability; ARC-002, FLOW-004.

OUT-007: HI installs the Human Backlog skills through the ci-solutions Pack

Architecture: OUT-007 in #spec-traceability; ARC-004, FLOW-004.

OUT-008: HI declares and validates the humanBacklog setting

Architecture: OUT-008 in #spec-traceability; ARC-005.

OUT-009: setup-human-backlog writes and proves a Human Backlog Config

Architecture: OUT-009 in #spec-traceability; ARC-007, FLOW-003.

OUT-010: An Eject gives a client a self-contained, reproducible zip

Architecture: OUT-010 in #spec-traceability; FLOW-003.

Acceptance Criteria

Every criterion maps in the architecture's #spec-traceability table under its own code.

  • AC-001: create-business-request creates a Business Request that reads back in Received, and its create payload has no State field.
    • Covers: OUT-001
    • Architecture: FLOW-001-STEP-001, ARC-003
  • AC-002: When analyze-business-request adds the first Feature link to a Received request, it calls ado.py set-state <id> "In analysis", and the request reads back In analysis.
    • Covers: OUT-001
    • Architecture: FLOW-001-STEP-002
  • AC-003: When plan-sprint assigns a sprint to the first linked Feature of a request, it calls ado.py set-state <id> Planned, and the request reads back Planned.
    • Covers: OUT-001
    • Architecture: FLOW-001-STEP-003
  • AC-004: update-business-request writes Rejected or Withdrawn only when the user asks for that state.
    • Covers: OUT-001
    • Architecture: FLOW-001-STEP-004
  • AC-005: revision-check allows free edit only for Received with no linked Feature, allows cascade only for In analysis or Planned with every linked Feature New or Planned, and blocks every other case with zero writes.
    • Covers: OUT-001
    • Architecture: FLOW-001-STEP-005
  • AC-006: ado.py set-state refuses a target earlier in Received → In analysis → Planned → In progress → On staging → Live, and refuses any target when the current state is Live, Rejected or Withdrawn; a refusal makes no write and exits nonzero. Rejected and Withdrawn are allowed from every non-final state.
    • Covers: OUT-002
    • Architecture: ARC-003, Models
  • AC-007: ado.py set-state with the current state makes no write and exits 0.
    • Covers: OUT-002
    • Architecture: ARC-003
  • AC-008: ado.py set-state patches State with a JSON Patch revision test and adds exactly one comment from --comment; a stale --expected-rev fails before any write.
    • Covers: OUT-002
    • Architecture: ARC-003, FLOW-002-STEP-004
  • AC-009: With humanBacklog set and a linked Business Request, write-backlog writes In progress at the first work-started fact in the Fog scope, On staging when every Story and Task has staging evidence, Live when the Fog completes, Withdrawn when the Fog becomes Cancelled, and nothing when the Fog becomes Superseded.
    • Covers: OUT-003
    • Architecture: FLOW-002-STEP-003
  • AC-010: The owed Human State is the highest state that all recorded evidence for the Fog scope supports; a later fact for an earlier state never lowers it.
    • Covers: OUT-003
    • Architecture: FLOW-002-STEP-003, Models
  • AC-011: Without humanBacklog, without a linked Business Request, or for work with no Fog, write-backlog makes zero Human Backlog writes and reports no failure.
    • Covers: OUT-003
    • Architecture: FLOW-002-STEP-003
  • AC-012: When humanBacklog is set and .agents/skills/human-backlog-ado/scripts/ado.py is absent, write-backlog returns setup guidance, makes zero Human Backlog writes, and completes its Core Backlog writes.
    • Covers: OUT-003
    • Architecture: FLOW-002-STEP-004
  • AC-013: When a Human State write fails, the Core Backlog writes of that run stay applied, the failed write appears in the residual delta, and the next delivery event retries it.
    • Covers: OUT-003
    • Architecture: FLOW-002-STEP-002, FLOW-002-STEP-005
  • AC-014: Each Human State change by write-backlog adds one comment in the request's language with the date and, when known, the release name, and no technical link.
    • Covers: OUT-003
    • Architecture: FLOW-002-STEP-004
  • AC-015: The write-backlog change is one new references/human-backlog.md plus one pointer line in SKILL.md step 9; the provider references, fog-intake.md and delivery-status.md are unchanged.
    • Covers: OUT-003
    • Architecture: ARC-006
  • AC-016: A linked Fog carries one Business Request link (Linear: attachment link; GitHub: body line Business Request: <url>), and the Business Request carries a back link to the Fog; write-backlog writes both at Fog intake when a request URL is supplied, or later on an explicit link instruction.
    • Covers: OUT-004
    • Architecture: ARC-008
  • AC-017: When write-backlog records a Fog as Superseded, both links move to the successor Fog in the same run, and no Fog links more than one Business Request.
    • Covers: OUT-004
    • Architecture: ARC-008, FLOW-002-STEP-003
  • AC-018: No shipped skill file or ado.py contains emera-group, Collective-Intelligence, the tenant b60db498-a991-498d-bfb5-7f0657f02891 or definitionId=1.
    • Covers: OUT-005
    • Architecture: ARC-003
  • AC-019: ado.py resolves config from ADO_* env vars, then humanBacklog in the nearest .devpunks/settings.json above the working directory, then config.json beside ado.py; it derives org and project from projectUrl; a missing provider, projectUrl or tenant stops with the key name before any network call; ado.py --help runs with no config.
    • Covers: OUT-005
    • Architecture: FLOW-005-STEP-001, FLOW-005-STEP-002, FLOW-005-STEP-003
  • AC-020: ado.py gets its token only from az account get-access-token --tenant <tenant>; when az is missing or not logged in it stops before any network call and tells the user to install the Azure CLI and run az login --tenant <tenant>.
    • Covers: OUT-005
    • Architecture: FLOW-005-STEP-004
  • AC-021: Skill files are English; each skill tells the agent to write saved content in the user's language and to keep an existing item's language when editing it.
    • Covers: OUT-005
    • Architecture: ARC-003
  • AC-022: ado.py planning-check still accepts only iterations of exactly two configured working weeks.
    • Covers: OUT-005
    • Architecture: ARC-003
  • AC-023: The published @collective-intelligence/backlog tarball root is exactly README.md, package.json and skills; skills holds exactly human-backlog-ado, create-business-request, analyze-business-request, update-business-request, plan-sprint, create-bug and setup-human-backlog; no test file is in the tarball.
    • Covers: OUT-006
    • Architecture: ARC-002
  • AC-024: ci-app CI runs python3 -m unittest discover -s tests for packages/public/backlog through test:pack, and the run passes.
    • Covers: OUT-006
    • Architecture: ARC-002
  • AC-025: package-skills.ts exports packageSkillSources with the lint and backlog sources; sync:package-skills copies both into apps/cli/skills/npm/<directory>/; the receipt .devpunks-cache/package-skills-sync.json holds one entry per package name; the lint source behavior is unchanged.
    • Covers: OUT-007
    • Architecture: ARC-004, FLOW-004-STEP-003
  • AC-026: skills.ts has the seven entries with tier: "framework", framework: "ci-solutions", language: null and requiresTools: ["python3"]; the ci-solutions Pack lists them; the tool catalog has no az entry.
    • Covers: OUT-007
    • Architecture: ARC-004
  • AC-027: hi update in a repo that depends on a CI SDK installs the seven skills under .agents/skills/.
    • Covers: OUT-007
    • Architecture: FLOW-004-STEP-005
  • AC-028: SettingsDocument accepts humanBacklog with provider azure-devops, a https://dev.azure.com/{org}/{project} URL, a UUID tenant and an optional https ratingsPipelineUrl; it rejects any other provider, URL host or tenant shape; hi check then fails with .devpunks/settings.json: <error>.
    • Covers: OUT-008
    • Architecture: ARC-005
  • AC-029: hi init asks no humanBacklog question, and hi update keeps an existing humanBacklog value unchanged.
    • Covers: OUT-008
    • Architecture: ARC-005, FLOW-003-STEP-002
  • AC-030: setup-human-backlog writes humanBacklog, then runs ado.py doctor; it returns ready only when every doctor check passes and otherwise blocked with the full mismatch list; doctor makes no write.
    • Covers: OUT-009
    • Architecture: FLOW-003-STEP-002, FLOW-003-STEP-003
  • AC-031: setup-human-backlog/references/process.md lists the five work-item types, every field the skills use, and the eight Human States.
    • Covers: OUT-009
    • Architecture: ARC-001, ARC-007
  • AC-032: ado.py eject fails without --out; with --out it writes one zip that holds the sibling skill folders without tests, config.json with the Human Backlog Config, and MANIFEST.json with package name, skill-tree sha256, config sha256 and date; the same installed tree gives the same skill-tree sha256.
    • Covers: OUT-010
    • Architecture: FLOW-003-STEP-004

Spec Invariants

INVRuleSource (Q anchor)FormPatternSeamModel
INV-001Automated writers move a Business Request forward only; Live, Rejected and Withdrawn stay final; a repeated write changes nothingQ34, Q36, Glossary Q49stateful-propertystateful command sequenceado.py set-statemodels/human-state.proof.ts
INV-002ado.py doctor reports ready only when every check passes; otherwise it reports blocked and writes nothingQ32, Glossary Q49propertysecurity gateado.py doctornone

Constraints

  • The team owns the Human Backlog process. Clients change only the Human Backlog Config (Q4, Q7).
  • Human State names are exactly Received, In analysis, Planned, In progress, On staging, Live, Rejected, Withdrawn; no mapping layer (Q2, Q3).
  • A Business Request has one active Fog; a Fog has at most one Business Request (Q21).
  • Merge is never staging; staging is never production (S10).
  • HI requires no provider-specific tool (Q27).
  • Sprints are two working weeks (Q5).
  • write-backlog stays the only Core Backlog writer; the skills repo takes no dependency on ci-app other than the helper path (Q25).

Dependency Readiness

Ready.

  • HI package skills sync and ci-solutions Pack: landed in wearedevpunks/harness-intelligence 886966be721e65c0d48d33c22046234af6f2e847 (#288).
  • ci-app public package release by glob and staged first publish: present at collective-intelligence-platform/ci-app d34b4b06bb (.github/scripts/npm_release.py:137-144, :617-621).
  • Effect Schema.isPattern and Schema.isUUID: Effect 4.1.0 packages/effect/src/Schema.ts lines 6889 and 7013.
  • tsprover@0.0.2 for the Human State Model.

Branch/Base Intent

  • wearedevpunks/harness-intelligence: branch team/stefan/backlog-for-humans-skill-pack, based on origin/main 886966be7; it already carries this spec and its architecture.
  • wearedevpunks/skills: the checked-out main only, per the repository's shared-skills rule (root CLAUDE.md); then bun run sync:skills in HI.
  • collective-intelligence-platform/ci-app: no accepted branch intent; the plan chooses one feature branch from main.

Architecture Source

Accepted Technical Decisions

  • ci-app package (Q39, Q42, Q48): packages/public/backlog/, name @collective-intelligence/backlog, files: ["README.md", "skills"], publishConfig.access: public, no build, no TypeScript sources; test runs python3 -m unittest discover -s tests; test:pack checks the tarball root and the seven skills, then runs test; tests live in packages/public/backlog/tests/. First publish needs one manual staged release run.
  • Helper (Q24, Q45): one catalogued unit human-backlog-ado with SKILL.md (helper reference for sibling skills) and scripts/ado.py as one file. Sibling skills call ../human-backlog-ado/scripts/ado.py.
  • ado.py (Q28, Q36, Q41, Q45): lazy load_config() replaces the ORG/PROJECT/TENANT constants; BR_FLOW = ("Received", "In analysis", "Planned", "In progress", "On staging", "Live"), BR_FINAL = {"Live", "Rejected", "Withdrawn"}; new commands doctor, set-state ID STATE --comment TEXT [--expected-rev N] [--dry-run], eject --out PATH; revision-check uses the new names; create sets no State; the existing commands stay.
  • HI catalog (Q43, Q27): collectiveIntelligenceBacklogVersion, collectiveIntelligenceBacklogSkills (directory: "collective-intelligence-backlog", tarballEnv: "HI_CI_BACKLOG_TARBALL"), packageSkillSources = [lint, backlog]; sync-package-skills.mjs iterates the list; receipt keyed by package name; seven skills.ts entries with requiresTools: ["python3"]; ci-solutions gains the seven skills and one promptDetails line.
  • Settings (Q31, Q44): HumanBacklogSettings = Schema.Struct({ provider: Schema.Literal("azure-devops"), projectUrl: Schema.String.check(Schema.isPattern(/^https:\/\/dev\.azure\.com\/[^/]+\/[^/]+\/?$/u)), tenant: Schema.String.check(Schema.isUUID()), ratingsPipelineUrl: Schema.optional(<https URL>) }); SettingsDocument.humanBacklog: Schema.optional(HumanBacklogSettings); decodeCheckSettings reads it; no ProjectIntent field.
  • write-backlog (Q25, Q29, Q46): new references/human-backlog.md; one pointer line in SKILL.md step 9; calls .agents/skills/human-backlog-ado/scripts/ado.py set-state.
  • Eject (Q33, Q47): --out required; zip holds sibling skill folders without tests, config.json, MANIFEST.json; no version in the filename.
  • Language (Q6, Q22): skill files English; saved content in the user's language; edits keep the item's language.

Accepted Testing Decisions

  • Giovanni's 72 offline unittest tests move to packages/public/backlog/tests/, adapted to the generic helper; new tests cover config resolution, set-state, doctor and eject (Q45).
  • ci-app CI runs them through test:pack; HI runs no Python tests and trusts the pinned published version (Q26, Q42).
  • The Human State Model models/human-state.proof.ts passes tsprover@0.0.2 with 153 distinct states; its four Sensitivity Proof mutants fail as recorded in the architecture Models section. INV-001 replays it as a stateful property over set-state.
  • HI catalog, sync and settings changes are tested with the existing Vitest suites around syncPackageSkills (tarball override) and settings decoding.

Verification Seams

  • ado.py CLI commands, driven against an in-memory Azure DevOps fake as in Giovanni's tests; no live work item is created to test a skill.
  • syncPackageSkills with HI_CI_BACKLOG_TARBALL pointing at a packed local tarball.
  • SettingsDocument decoding and hi check on a fixture settings file.
  • hi update on a fixture repo that depends on a CI SDK.
  • write-backlog and the five Markdown skills: their reference text and the ado.py commands they call; no automated test drives a skill prompt.

Parked Decisions

ItemOwnerResume trigger
Delivery step that records staging and production evidencenot recordedWhen a delivery caller can observe deployments
Giovanni confirmations: one script; state rename; Feature Ratings Sync use of ado.pyStefan with GiovanniJoint review before the first publish of @collective-intelligence/backlog

Decision Log

DecisionEvidenceRationale
Skills ship from ci-app through ci-solutions, not a new PackQ38Reuses the #288 mechanism
Keep ado.py, generic, az-onlyQ10, Q41One enforced write path; keeps Giovanni's setup
Fixed Human State names, forward-only in set-stateQ3, Q36No mapping layer; one rule for every writer
Fog ↔ Business Request, written by write-backlogQ13, Q14, Q15Fog completion already uses production evidence
Owed state derived from all evidenceArchitecture Models finding; Q19"Last event wins" loses Live
humanBacklog validated in SettingsDocumentQ31, Q44Documented settings contract
Eject identified by skill-tree hashQ47An installed skill cannot read its npm version

On this page