Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: require dispatch labels for reference-watch issues

[._.]/ Adam Eivy3e000c222970
diff --git a/docs/QUOTA-BURN.md b/docs/QUOTA-BURN.md
index 0d7a27fc6b..52a72c55e8 100644
--- a/docs/QUOTA-BURN.md
+++ b/docs/QUOTA-BURN.md
@@ -387,13 +387,14 @@ it, name the path that actually reaches the failure, and decide the fix (files,
tests, and the rejected alternative) before filing. The cap stays at 5 issues
with two or three as the target — depth over volume.
-Filing carries a **required** label contract: exactly one `model:` and exactly
-one `effort:` label on every issue, chosen as independent axes from the code the
-agent just read (`MANDATORY_DISPATCH_HINT_GUIDANCE` in `server/lib/dispatchLabels.js`).
-Contributor labels (`good first issue`, `help wanted`) stay optional, missing
-labels are created lazily, category labels (`plan`, `ux`, `bug`, `tests`,
-`area:*`, …) are preserved, and the agent reads each new issue's labels back to
-repair any that did not stick.
+Filing carries a **required** label contract for quota-burn audits,
+`reference-watch`, and `repo-study`: exactly one `model:` and exactly one
+`effort:` label on every issue, chosen as independent axes from the code the
+agent just read (`MANDATORY_DISPATCH_HINT_GUIDANCE` in
+`server/lib/dispatchLabels.js`). Contributor labels (`good first issue`, `help
+wanted`) stay optional, missing labels are created lazily, category labels
+(`plan`, `ux`, `bug`, `tests`, `area:*`, …) are preserved, and the agent reads
+each new issue's labels back to repair any that did not stick.
### The "lands no code" postures
diff --git a/server/lib/README.md b/server/lib/README.md
index f08b5790d4..c9ef66f540 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -515,7 +515,7 @@ pm` default, `NPM_CONFIG_PREFIX`, nvm/Volta) installed `codex` successfully and
| `assetRoutePrefixes.js` | Import-free leaf holding the URL prefixes the server owns: `ASSET_ROUTE_PREFIXES` (every `/data/**` static mount) and `SERVER_OWNED_PREFIXES` (what must never reach the SPA fallback, each with the exact `spaPaths` that ARE client routes). `scripts/dev-proxy-drift.test.js` checks the dev proxy's `^/data/` wildcard against the mounts, pins the route-registration order in `server/index.js` (a router added below the terminators is shadowed), and fails if a client route — from `NAV_COMMANDS` or `App.jsx`'s nested `<Route>` tree — is ever added under a server-owned prefix without being declared. |
| `asyncMutex.js` | Promise-based async mutex. |
| `concurrencyGate.js` | `createConcurrencyGate(limit)` → `run(fn)` — cap on simultaneous async work for ONE module-scoped budget, released FIFO. Sibling to `mapWithConcurrency.js`, which caps in-flight work *within one array map*; a gate is shared state, so several call sites fanning out at the same remote respect one budget instead of each respecting its own while the host sees the sum. `createMutex` (`asyncMutex.js`) is this with `limit` fixed at 1 — prefer it for mutual exclusion. Note the budget is per-MODULE, not per-host: two modules calling one host each get their own gate. Used by `huggingFaceCatalog.js` (4) and `ollamaRegistryCatalog.js` (16), whose cold catalog-enrichment bursts otherwise arrive at a free public API as a thundering herd — which the Hub answers with an HTTP/2 GOAWAY that surfaces as a bare `fetch failed`. |
-| `dispatchLabels.js` | slashdo dispatch-hint contract: `model:light/medium/heavy` + `effort:low/medium/high/xhigh/max` vocabulary, prescribed forge colors, validation (`normalizeDispatchModel` / `normalizeDispatchEffort`), the read-side inverse (`dispatchHintFromLabels` — recovers `{model, effort}` from a raw label-name list, used by branch-reconcile's per-branch routing hint), GitHub/GitLab vs Jira label formatting, optional contributor labels (`good first issue` / `help wanted`, never implied by `model:light`, and released at claim time by `formatContributorLabelReleaseCommands` — one best-effort command per label, since a forge fails the whole edit when a named label is absent), the one shared volunteer-claim policy (`volunteerClaimLabels` / `formatVolunteerClaimCommands` — a human comment claiming an unassigned issue is resolved by BOTH issueWatcher.js's deterministic pass and the claim prompt's Phase 1 handoff, so both stamp `in-progress` and retire the invitations rather than writing opposite state), the open-ended planner-attribution axis (`planner:<model>`, `normalizePlannerId` / `resolvePlannerId` / `formatPlannerLabelGuidance` — records WHICH model wrote the plan, prefix-matched by `dispatchLabelSpec` so it lazily creates like the fixed labels; a filing agent takes the value from its prompt, never from self-identification), the workflow-state markers (`EPIC_LABEL`/`EPIC_DECOMPOSED_LABEL` and `IN_PROGRESS_LABEL` — state, not hints: shared with perpetualWork.js#isActionableIssue, issueReconcile.js's zombie scan, issueWatcher.js's volunteer assignment, and the claim prompts), lazy-create command text, the optional `--label` slots a rendered `issue create` example offers (`OPTIONAL_ISSUE_LABEL_FLAG_SLOTS` / `formatOptionalIssueLabelFlags` — one list so a new axis reaches every prompt template's copy-pasteable command, not just its prose), and shared dispatch plus issue-quality guidance (`ISSUE_QUALITY_GUIDANCE`, `DISPATCH_HINT_GUIDANCE`, `JIRA_DISPATCH_HINT_GUIDANCE`, plus the consumer-side pair `DISPATCH_HINT_READING_GUIDANCE` / `DISPATCH_HINT_FANOUT_GUIDANCE` — what the labels mean to an agent that RECEIVES them (the preloaded `open-issues` task data input) and, for an orchestrator only, how to route each sub-agent by its own issue (the swarm block); the fan-out form is the reading form plus one line, never a second copy of the vocabulary). Omit an unjustified axis; never invent `medium`; reject future-only/speculative work while keeping useful current refactors claimable. Consumed by work-tracker instructions, quota-burn audits, Layered Intelligence filing, and claim follow-up prompts. |
+| `dispatchLabels.js` | slashdo dispatch-hint contract: `model:light/medium/heavy` + `effort:low/medium/high/xhigh/max` vocabulary, prescribed forge colors, validation (`normalizeDispatchModel` / `normalizeDispatchEffort`), the read-side inverse (`dispatchHintFromLabels` — recovers `{model, effort}` from a raw label-name list, used by branch-reconcile's per-branch routing hint), GitHub/GitLab vs Jira label formatting, optional contributor labels (`good first issue` / `help wanted`, never implied by `model:light`, and released at claim time by `formatContributorLabelReleaseCommands` — one best-effort command per label, since a forge fails the whole edit when a named label is absent), the one shared volunteer-claim policy (`volunteerClaimLabels` / `formatVolunteerClaimCommands` — a human comment claiming an unassigned issue is resolved by BOTH issueWatcher.js's deterministic pass and the claim prompt's Phase 1 handoff, so both stamp `in-progress` and retire the invitations rather than writing opposite state), the open-ended planner-attribution axis (`planner:<model>`, `normalizePlannerId` / `resolvePlannerId` / `formatPlannerLabelGuidance` — records WHICH model wrote the plan, prefix-matched by `dispatchLabelSpec` so it lazily creates like the fixed labels; a filing agent takes the value from its prompt, never from self-identification), the workflow-state markers (`EPIC_LABEL`/`EPIC_DECOMPOSED_LABEL` and `IN_PROGRESS_LABEL` — state, not hints: shared with perpetualWork.js#isActionableIssue, issueReconcile.js's zombie scan, issueWatcher.js's volunteer assignment, and the claim prompts), lazy-create command text, the optional `--label` slots a rendered `issue create` example offers (`OPTIONAL_ISSUE_LABEL_FLAG_SLOTS` / `formatOptionalIssueLabelFlags` — one list so a new axis reaches every prompt template's copy-pasteable command, not just its prose), and shared dispatch plus issue-quality guidance (`ISSUE_QUALITY_GUIDANCE`, `DISPATCH_HINT_GUIDANCE`, `MANDATORY_DISPATCH_HINT_GUIDANCE`, `JIRA_DISPATCH_HINT_GUIDANCE`, `MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE`, `REFERENCE_WATCH_LABEL_CONTRACT`, plus the consumer-side pair `DISPATCH_HINT_READING_GUIDANCE` / `DISPATCH_HINT_FANOUT_GUIDANCE` — what the labels mean to an agent that RECEIVES them (the preloaded `open-issues` task data input) and, for an orchestrator only, how to route each sub-agent by its own issue (the swarm block); the fan-out form is the reading form plus one line, never a second copy of the vocabulary). Generic filing callers omit an unjustified axis; evidence-rich reference-watch/repo-study/quota-burn callers require both; never invent `medium`; reject future-only/speculative work while keeping useful current refactors claimable. Consumed by work-tracker instructions, quota-burn audits, Layered Intelligence filing, and claim follow-up prompts. |
| `domainAutonomy.js` | Per-domain autonomy guardrails (pure). `AUTONOMY_DOMAINS`/`DOMAIN_IDS`/`DOMAIN_MODES` (`off`/`dry-run`/`execute`), `getDomainMode(config, id)`, and `normalizeDomainAutonomy(raw)` to coerce a hand-edited/partial map. Default per domain is `execute` (reproduces pre-#711 behavior, so no migration needed). Also `CREATIVE_DOMAIN`/`getCreativeAutonomyMode(config)` (#2183) — the Creative Director orchestrator domain, kept out of `DOMAIN_IDS` and defaulting to mirror the `cos` mode. |
| `domainBudgets.js` | Per-domain daily autonomy budgets (pure). `BUDGET_LIMIT_FIELDS` (`maxActionsPerDay`/`maxMinutesPerDay`), `getDomainBudget(config, id)`, `normalizeDomainBudgets(raw)`, `hasBudget(budget)`, and `evaluateBudget(budget, usage)` → `{ withinBudget, exceeded }`. A `null`/non-positive cap means unlimited (default per domain, so no migration needed). Token/$ caps are intentionally absent — CLI subscription providers expose no per-run metering. Usage ledger + gate wiring live in `services/domainUsage.js`. |
| `eidoverseWorldDesign.js` | Immutable Eidoverse World Design V1/V2/V3 registry, override migration, semantic districts, 48-signal ceiling, and install-local asset locks for PortOS Commons. |
diff --git a/server/lib/dispatchLabels.js b/server/lib/dispatchLabels.js
index ad3775dbeb..f403f18958 100644
--- a/server/lib/dispatchLabels.js
+++ b/server/lib/dispatchLabels.js
@@ -628,6 +628,17 @@ export const JIRA_DISPATCH_HINT_GUIDANCE = [
ISSUE_QUALITY_GUIDANCE,
].join('\n');
+/** Jira form of the complete-label contract used by evidence-rich planners. */
+export const MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE = JIRA_DISPATCH_HINT_GUIDANCE
+ .replace(
+ 'Dispatch hints are optional, independent Jira labels',
+ 'Dispatch labels are REQUIRED on every issue you file: exactly one `model-*` and exactly one `effort-*` independent Jira label',
+ )
+ .replace(
+ 'Choose each axis only when the work you just inspected justifies it. Omit an axis rather than guessing. ',
+ 'Choose each axis only when the work you just inspected justifies it; never omit either required axis. ',
+ );
+
/**
* Current PortOS scope-label vocabulary. The forge remains the source of truth
* at filing time (`gh label list --search area:` / `glab label list`), while this
@@ -669,6 +680,8 @@ export const PORTOS_AREA_LABEL_GUIDANCE = [
export const REPO_STUDY_LABEL_CONTRACT = Object.freeze({
forgeFlags: '--label area:<area> --label model:<tier> --label effort:<level>',
jiraFlags: '`area:<area>` + `model-<tier>` + `effort-<level>`',
+ dispatchGuidance: MANDATORY_DISPATCH_HINT_GUIDANCE,
+ jiraDispatchGuidance: MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE,
instructions: [
'**Repo-study complete-label contract (mandatory):** every NEW proposal must carry `repo-study`, `plan`, at least one relevant `area:*`, exactly one justified model label (`model:*` on GitHub/GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub/GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected PortOS files and proposed implementation, never by stamping `medium` on both.',
PORTOS_AREA_LABEL_GUIDANCE,
@@ -676,6 +689,24 @@ export const REPO_STUDY_LABEL_CONTRACT = Object.freeze({
].join('\n'),
});
+/**
+ * Reference-watch proposals are based on a traced upstream diff, so they have
+ * the same evidence needed to choose both dispatch axes as repo studies do.
+ * Keep this contract separate from the general optional guidance: a prompt
+ * that says "omit an axis" immediately before a reference-watch create command
+ * is how otherwise well-researched issues land without routing labels.
+ */
+export const REFERENCE_WATCH_LABEL_CONTRACT = Object.freeze({
+ forgeFlags: '--label model:<tier> --label effort:<level>',
+ jiraFlags: '`model-<tier>` + `effort-<level>`',
+ dispatchGuidance: MANDATORY_DISPATCH_HINT_GUIDANCE,
+ jiraDispatchGuidance: MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE,
+ instructions: [
+ '**Reference-watch complete-label contract (mandatory):** every NEW proposal must carry `reference-watch`, `plan`, exactly one justified model label (`model:*` on GitHub/GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub/GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected reference diff and proposed implementation, never by stamping `medium` on both.',
+ 'If a proposal cannot be classified defensibly on both axes, do not file it; filing an incomplete issue is not a valid fallback. After each NEW issue, read its labels back and repair any missing required label before continuing; never relabel a duplicate you skipped.',
+ ].join('\n'),
+});
+
/** Repo-study contract for managed apps whose label taxonomy is not PortOS's. */
export const GENERIC_REPO_STUDY_LABEL_CONTRACT = Object.freeze({
forgeFlags: '--label area:<area> --label model:<tier> --label effort:<level>',
diff --git a/server/lib/dispatchLabels.test.js b/server/lib/dispatchLabels.test.js
index 4fd14070ba..c81965325e 100644
--- a/server/lib/dispatchLabels.test.js
+++ b/server/lib/dispatchLabels.test.js
@@ -8,6 +8,7 @@ import {
DISPATCH_HINT_FANOUT_GUIDANCE,
DISPATCH_HINT_READING_GUIDANCE,
MANDATORY_DISPATCH_HINT_GUIDANCE,
+ MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE,
JIRA_DISPATCH_HINT_GUIDANCE,
PORTOS_AREA_LABELS,
PORTOS_AREA_LABEL_GUIDANCE,
@@ -329,6 +330,14 @@ describe('shared guidance', () => {
expect(MANDATORY_DISPATCH_HINT_GUIDANCE).toContain('stay OPTIONAL');
});
+ it('keeps Jira complete-label guidance mandatory without changing optional Jira callers', () => {
+ expect(MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE).toContain('REQUIRED on every issue you file');
+ expect(MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE).toContain('model-light|model-medium|model-heavy');
+ expect(MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE).toContain('effort-low|effort-medium|effort-high|effort-xhigh|effort-max');
+ expect(MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE).not.toContain('Omit an axis rather than guessing');
+ expect(JIRA_DISPATCH_HINT_GUIDANCE).toContain('Omit an axis rather than guessing');
+ });
+
it('keeps the PortOS area vocabulary and repo-study complete-label contract explicit', () => {
expect(PORTOS_AREA_LABELS).toContain('area:cos-agents');
expect(PORTOS_AREA_LABELS).toContain('area:media');
diff --git a/server/lib/workTracker.js b/server/lib/workTracker.js
index b48dbb18f7..bc8fec1753 100644
--- a/server/lib/workTracker.js
+++ b/server/lib/workTracker.js
@@ -18,6 +18,7 @@
import {
DISPATCH_HINT_GUIDANCE,
JIRA_DISPATCH_HINT_GUIDANCE,
+ REFERENCE_WATCH_LABEL_CONTRACT,
REPO_STUDY_LABEL_CONTRACT,
formatOptionalIssueLabelFlags,
} from './dispatchLabels.js';
@@ -182,6 +183,7 @@ export const TRACKER_FILING_PRESETS = {
// The forge label applied to each filed issue (created if absent).
issueLabel: 'reference-watch',
labelDescription: 'Proposed from a reference-repo watch',
+ issueLabelContract: REFERENCE_WATCH_LABEL_CONTRACT,
// Everything after `**<Short title.>** ` in the PLAN.md checklist item.
planItemBody: 'From `reference-watch` review of <ref name> (commit(s) `<sha>` [+ `<sha>` …], <today\'s date>). <1–2 sentences.> Fix: <files + functions in {appName}>. <Estimated scope.>',
// What the forge issue / JIRA description body must contain.
@@ -254,14 +256,27 @@ export const TRACKER_FILING_TASK_TYPES = new Set(Object.keys(TRACKER_FILING_PRES
* @param {object} [options] wording overrides — see TRACKER_FILING_PRESETS
*/
export function formatTrackerInstructions(tracker, options = {}) {
+ const referenceWatchPreset = TRACKER_FILING_PRESETS['reference-watch'];
const {
slugPrefix, label, issueLabel, labelDescription,
- issueLabelContract,
planItemBody, bodyRequirements, planCommitMessage,
- } = { ...TRACKER_FILING_PRESETS['reference-watch'], ...options };
+ } = { ...referenceWatchPreset, ...options };
+ // The reference-watch preset is the backwards-compatible default, but its
+ // complete-label contract must not bleed into other filing presets when they
+ // omit an issueLabelContract of their own.
+ const issueLabelContract = options.issueLabelContract
+ || (slugPrefix === referenceWatchPreset.slugPrefix ? REFERENCE_WATCH_LABEL_CONTRACT : null);
+ const dispatchLabelCreateWording = issueLabelContract
+ ? 'Then create each required dispatch-hint label immediately before applying it.'
+ : 'Then create each justified dispatch-hint label immediately before applying it.';
+ const jiraDispatchLabelWording = issueLabelContract
+ ? `plus the required equivalent dispatch-hint labels ${issueLabelContract.jiraFlags}:`
+ : 'plus equivalent dispatch-hint labels when justified:';
// Rendered from the shared slot list rather than a literal, so a new label
// axis reaches this copy-pasteable example without re-patching it here.
const forgeLabelFlags = formatOptionalIssueLabelFlags(issueLabelContract?.forgeFlags);
+ const dispatchGuidance = issueLabelContract?.dispatchGuidance || DISPATCH_HINT_GUIDANCE;
+ const jiraDispatchGuidance = issueLabelContract?.jiraDispatchGuidance || JIRA_DISPATCH_HINT_GUIDANCE;
const jiraLabelContract = issueLabelContract
? `\n ${issueLabelContract.instructions.split('\n').join('\n ')}\n For JIRA, use the equivalent labels ${issueLabelContract.jiraFlags}.`
: '';
@@ -288,8 +303,8 @@ export function formatTrackerInstructions(tracker, options = {}) {
- **Inventory:** From {repoPath}, resolve the repo (\`gh repo view --json nameWithOwner -q .nameWithOwner\`) and list existing ${label} issues so you don't duplicate: \`gh issue list --state all --search "${slugStem} in:title" --limit 100 --json number,title\`. Each carries a \`[${slugPrefix}…]\` slug in its title — collect them. If \`gh\` is not authenticated or the remote is not GitHub, exit cleanly.
- **Record** each NEW proposal as a GitHub issue. Do not relabel or edit an existing issue you skipped as a duplicate. Keep the \`[<slug>]\` inventory tag in the title so later runs can de-duplicate; do NOT add \`[category]\` / \`[SEVERITY]\` / \`[model:…]\` / \`[effort:…]\` prefixes (those belong in labels).
- 1. Ensure each label you will apply exists. Create the category label first (\`gh label create ${issueLabel} --description "${labelDescription}" --force\`) and \`gh label create plan --description "Tracked by /do:replan" --force\`. Then create each justified dispatch-hint label immediately before applying it.
- 2. ${DISPATCH_HINT_GUIDANCE.split('\n').join('\n ')}
+ 1. Ensure each label you will apply exists. Create the category label first (\`gh label create ${issueLabel} --description "${labelDescription}" --force\`) and \`gh label create plan --description "Tracked by /do:replan" --force\`. ${dispatchLabelCreateWording}
+ 2. ${dispatchGuidance.split('\n').join('\n ')}
${forgeLabelContract}
${forgeFileStep} File with repeated \`--label\` flags so the category/scope labels stay intact:
\`\`\`bash
@@ -302,8 +317,8 @@ ${forgeLabelContract}
- **Inventory:** From {repoPath}, confirm the forge (\`glab repo view\`) and list existing ${label} issues so you don't duplicate: \`glab issue list --label ${issueLabel} --per-page 100 --output json\` (also scan titles for the \`[${slugPrefix}…]\` slug). Collect the existing slugs. If \`glab\` is not authenticated or the remote is not GitLab, exit cleanly.
- **Record** each NEW proposal as a GitLab issue. Do not relabel or edit an existing issue you skipped as a duplicate. Keep the \`[<slug>]\` inventory tag in the title so later runs can de-duplicate; do NOT add \`[category]\` / \`[SEVERITY]\` / \`[model:…]\` / \`[effort:…]\` prefixes (those belong in labels).
- 1. Ensure each label you will apply exists. Create the category label first (\`glab label create --name ${issueLabel} --color "#0366D6" --description "${labelDescription}" 2>/dev/null || true\`) and the same for \`plan\`. Then create each justified dispatch-hint label immediately before applying it (glab needs \`--name\` and \`#<hex>\`).
- 2. ${DISPATCH_HINT_GUIDANCE.split('\n').join('\n ')}
+ 1. Ensure each label you will apply exists. Create the category label first (\`glab label create --name ${issueLabel} --color "#0366D6" --description "${labelDescription}" 2>/dev/null || true\`) and the same for \`plan\`. ${dispatchLabelCreateWording} (glab needs \`--name\` and \`#<hex>\`).
+ 2. ${dispatchGuidance.split('\n').join('\n ')}
${forgeLabelContract}
${forgeFileStep} File with repeated \`--label\` flags so the category/scope labels stay intact:
\`\`\`bash
@@ -315,8 +330,8 @@ ${forgeLabelContract}
jira: `This app tracks autonomous work in **JIRA**. Create one JIRA issue per proposal in the app's configured project using whatever JIRA CLI/REST this environment provides. **If no JIRA credentials are available, fall back to recording proposals in PLAN.md at {repoPath} (slug-tagged \`- [ ] [<slug>] …\` checklist items under \`## Next Up\`, committed) and say so in your final summary.**
- **Inventory:** Search existing JIRA issues (and PLAN.md, if you fall back) for the \`[${slugPrefix}…]\` slug so you don't duplicate; collect the existing slugs.
-- **Record** each NEW proposal as a JIRA issue whose summary starts with the \`[<slug>]\` tag. Do not relabel a ticket you skipped as a duplicate. The description must contain ${bodyRequirements}. Apply the category label \`${issueLabel}\` plus equivalent dispatch-hint labels when justified:
- ${JIRA_DISPATCH_HINT_GUIDANCE.split('\n').join('\n ')}
+- **Record** each NEW proposal as a JIRA issue whose summary starts with the \`[<slug>]\` tag. Do not relabel a ticket you skipped as a duplicate. The description must contain ${bodyRequirements}. Apply the category label \`${issueLabel}\` ${jiraDispatchLabelWording}
+ ${jiraDispatchGuidance.split('\n').join('\n ')}
${jiraLabelContract}
For **Maybe — needs human call** items, end the description with \`**Decision needed:** <one sentence>.\`.
- **Finalize:** No source-code edits, no branches, no PRs — the tickets (or the committed PLAN.md fallback) ARE the deliverable. The \`claim-issue-jira\` flow picks them up later.`,
diff --git a/server/lib/workTracker.trackerInstructions.test.js b/server/lib/workTracker.trackerInstructions.test.js
index 352564d589..d1f174b56a 100644
--- a/server/lib/workTracker.trackerInstructions.test.js
+++ b/server/lib/workTracker.trackerInstructions.test.js
@@ -11,8 +11,10 @@
import { describe, it, expect } from 'vitest';
import {
- DISPATCH_HINT_GUIDANCE,
JIRA_DISPATCH_HINT_GUIDANCE,
+ MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE,
+ MANDATORY_DISPATCH_HINT_GUIDANCE,
+ REFERENCE_WATCH_LABEL_CONTRACT,
REPO_STUDY_LABEL_CONTRACT,
formatOptionalIssueLabelFlags,
} from './dispatchLabels.js';
@@ -31,11 +33,12 @@ const EXPECTED_PLAN = `This app records autonomous work in **PLAN.md** at the re
- **Finalize:** Commit the PLAN.md edit with message \`docs(reference-watch): propose <N> item(s) from <ref names>\`. Do NOT create branches or PRs — \`/claim\` (or the \`plan-task\` agent) picks the slugs up later.`;
function expectForgeDispatchContract(block, { cli, issueLabel }) {
- expect(block).toContain(DISPATCH_HINT_GUIDANCE.split('\n')[0]);
+ expect(block).toContain(MANDATORY_DISPATCH_HINT_GUIDANCE.split('\n')[0]);
expect(block).toContain('model:light|medium|heavy');
expect(block).toContain('effort:low|medium|high|xhigh|max');
- expect(block).toContain('Omit an axis rather than guessing');
- expect(block).toContain(`--label ${issueLabel} --label plan ${formatOptionalIssueLabelFlags()}`);
+ expect(block).toContain('REQUIRED on every issue you file');
+ expect(block).not.toContain('Omit an axis rather than guessing');
+ expect(block).toContain(`--label ${issueLabel} --label plan ${formatOptionalIssueLabelFlags(REFERENCE_WATCH_LABEL_CONTRACT.forgeFlags)}`);
// The planner axis is part of that list, so the copy-pasteable command offers
// it — not just the guidance prose above it.
expect(block).toContain('[--label planner:<model>]');
@@ -78,6 +81,10 @@ describe('formatTrackerInstructions — forge dispatch hints (#4351)', () => {
const github = formatTrackerInstructions('github', REF_WATCH);
expectForgeDispatchContract(github, { cli: 'gh', issueLabel: 'reference-watch' });
expect(github).toContain('--search "ref-watch in:title"');
+ expect(github).toContain('Reference-watch complete-label contract (mandatory)');
+ expect(github).not.toContain('[--label model:<tier>]');
+ expect(github).not.toContain('[--label effort:<level>]');
+ expect(github).toContain('create each required dispatch-hint label');
expect(formatTrackerInstructions('github')).toBe(github);
expect(formatTrackerInstructions('github', TRACKER_FILING_PRESETS['reference-watch'])).toBe(github);
});
@@ -86,13 +93,16 @@ describe('formatTrackerInstructions — forge dispatch hints (#4351)', () => {
const gitlab = formatTrackerInstructions('gitlab', REF_WATCH);
expectForgeDispatchContract(gitlab, { cli: 'glab', issueLabel: 'reference-watch' });
expect(gitlab).toContain('glab issue list --label reference-watch');
+ expect(gitlab).toContain('Reference-watch complete-label contract (mandatory)');
expect(formatTrackerInstructions('gitlab')).toBe(gitlab);
});
it('teaches Jira the hyphenated equivalent labels and leaves PLAN.md fallback intact', () => {
const jira = formatTrackerInstructions('jira', REF_WATCH);
- expect(jira).toContain(JIRA_DISPATCH_HINT_GUIDANCE.split('\n')[0]);
- expect(jira).toContain('model-light|model-medium|model-heavy');
+ expect(jira).toContain(MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE.split('\n')[0]);
+ expect(jira).not.toContain(JIRA_DISPATCH_HINT_GUIDANCE.split('\n')[0]);
+ expect(jira).toContain('`model-<tier>` + `effort-<level>`');
+ expect(jira).toContain('plus the required equivalent dispatch-hint labels');
expect(jira).toContain('effort-low|effort-medium|effort-high|effort-xhigh|effort-max');
expect(jira).toContain('Do not relabel a ticket you skipped as a duplicate');
expect(jira).toContain('Issue-quality gate');