Skip to content

fix(#479): add create-on-missing fallback for ready-for-review label - #481

Merged
maruiz93 merged 7 commits into
mainfrom
agent/479-label-create-on-missing
Aug 18, 2026
Merged

fix(#479): add create-on-missing fallback for ready-for-review label#481
maruiz93 merged 7 commits into
mainfrom
agent/479-label-create-on-missing

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #479. Rewrites the original approach from scratch on current main
(original was 212 commits behind with unresolvable conflicts due to
forge abstraction and bundling changes).

  • New shared library scripts/lib/labels.lib.sh with
    forge_ensure_label() that creates mandatory dispatch labels without
    --force, preserving admin customizations
  • Mandatory labels: ready-for-review, ready-to-code,
    ready-for-triage — auto-created when missing
  • Non-mandatory labels: silently skipped (no-op)
  • Wired into post-code.src.sh (ready-for-review) and
    post-triage.src.sh (ready-to-code) via the shared lib
  • Inline fix in post-retro.sh: removed --force from
    ready-for-triage creation (non-bundled script, can't use shared lib)
  • Unit tests for the lib + grep check in post-code-test.sh

Design decisions (from team sync 2026-07-29)

  • Mandatory vs optional: only dispatch/handoff labels are
    auto-created; optional labels fail silently if missing
  • No --force: preserves admin-customized descriptions and colors
  • On-the-fly: labels created at runtime by post-scripts, not by
    the enrollment installer
  • Warning on failure: label application failure emits a warning
    and continues (no exit 1 after push+PR creation)

Follow-up

  • Convert post-review.sh and post-retro.sh to bundled scripts,
    then migrate to the shared labels.lib.sh

Test plan

  • labels-test.sh: 8 unit tests for forge_ensure_label
  • post-code-test.sh: grep check for forge_ensure_label in
    bundled script
  • Full test suite passes (make test)
  • Manual: set up a fresh repo without labels, run code agent,
    verify ready-for-review is created and review agent dispatches
  • Manual: verify existing repos with customized label
    descriptions are not overwritten

🤖 Generated with Claude Code

@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 28, 2026 00:40

@ifireball ifireball left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we want this at all (this is a retor-agent suggested change that should've been discussed IMO) - not having certain labels is a way for repo owners to avoid having fullsend set the labels on the repos, though perhaps we should have mandatory and optional labels, where the mandatory ones are the ones used to hand-off work between agents and may be auto-created

@maruiz93 maruiz93 self-assigned this Jul 29, 2026
@maruiz93
maruiz93 force-pushed the agent/479-label-create-on-missing branch from b15f90a to ee2de36 Compare July 30, 2026 08:41
@maruiz93
maruiz93 requested a review from ifireball July 30, 2026 09:12
Comment thread scripts/post-code.src.sh
@maruiz93
maruiz93 force-pushed the agent/479-label-create-on-missing branch 2 times, most recently from 81ce8c4 to 0b13210 Compare July 31, 2026 08:38
@maruiz93

Copy link
Copy Markdown
Contributor

We discussed this in the Jul 29 team sync. The team aligned on two clear groups:

  1. Mandatory labels (dispatch/handoff: ready-for-review, ready-to-code, ready-for-triage) — auto-created on the fly when missing
  2. Optional labels (agent suggestions: good-first-issue, question, etc.) — fail silently if missing

This PR implements that distinction. The shared ensure_label() in scripts/lib/labels.lib.sh handles the mandatory labels. For optional labels in post-triage.sh, the existing label_exists guard (line 505) still skips non-existent labels without creating them.

@maruiz93 maruiz93 added the ready-for-review Triggers review agent dispatch label Jul 31, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:10 AM UTC · Completed 9:28 AM UTC
Commit: 0b13210 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [scope-exceeded] scripts/post-triage.src.sh:29 — Changes to scripts/post-triage.src.sh (sourcing labels.lib.sh and adding forge_ensure_label call) are outside the scope authorized by issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479. The issue explicitly scopes the work to: (1) post-code.src.sh and (2) post-code-test.sh. The bundled counterpart scripts/post-triage.sh carries the same unauthorized changes. Per AGENTS.md rule 3: "Every changed line in your diff must trace directly to the issue scope."
    Remediation: Either file a separate issue authorizing the post-triage ensure_label wiring, or remove the post-triage.src.sh and post-triage.sh changes from this PR.

  • [protected-path] scripts/ — 8 of 9 changed files (scripts/lib/labels.lib.sh, scripts/labels-test.sh, scripts/post-code-test.sh, scripts/post-code.sh, scripts/post-code.src.sh, scripts/post-retro.sh, scripts/post-triage.sh, scripts/post-triage.src.sh) are under the scripts/ protected path. The PR links to issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479 which provides context for these changes. Human approval is always required for protected-path changes regardless of context.

Low

  • [scope-exceeded] scripts/post-retro.sh:194 — The rewrite of the inline gh label create block in post-retro.sh is outside issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479's authorized scope. The --force removal aligns with the issue's intent (preserving admin customizations), but the description/color metadata changes are not authorized by the issue.

  • [GHA-workflow-command-injection] scripts/lib/labels.lib.sh:55 — The error handler echo "Warning: gh label create ${name}: ${err}" writes unsanitized stderr from gh label create to the runner's stderr without sanitizing for GHA workflow command sequences (::, %0A, %0D). While the label name is constrained to the MANDATORY_LABELS whitelist, ${err} could theoretically contain injected sequences. See also: [GHA-workflow-command-injection] finding in post-retro.sh.

  • [GHA-workflow-command-injection] scripts/post-retro.sh:200 — The inline error handler echo "Warning: gh label create ready-for-triage: ${_lbl_err}" has the same unsanitized stderr risk. The file already demonstrates sanitization patterns (SAFE_TITLE) that could be applied here.

  • [error-handling-gap] scripts/lib/labels.lib.sh:52forge_ensure_label() captures both stdout and stderr via 2>&1 and checks the combined output for 'already exists'. While the check only runs on command failure (the if ! guard), capturing both streams together is less precise than capturing stderr alone.

  • [over-engineering] scripts/lib/labels.lib.sh:13 — MANDATORY_LABELS defines 3 labels when issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479 only authorizes ready-for-review. The ready-to-code and ready-for-triage entries are exercised only by the out-of-scope post-triage and post-retro changes.

  • [test-inadequate] scripts/labels-test.sh — No test covers the case where both REPO_FULL_NAME and REPO are unset. The library would silently pass an empty --repo argument to gh label create, producing a confusing API error.

  • [naming-convention] scripts/lib/labels.lib.sh:10 — Include guard LABELS_LIB_SH_LOADED does not follow the established convention. Other libs use <STEM>_SH_LOADED (e.g., GITLEAKS_INSTALL_SH_LOADED, PR_ASSIGNEE_SH_LOADED). Expected: LABELS_SH_LOADED.

  • [naming-convention] scripts/lib/labels.lib.sh:15 — Private helper _mandatory_label_defaults lacks a lib-specific namespace prefix. Other libs prefix private functions (e.g., _pr_assignee_warn, _gitlab_code_api). Expected: _labels_mandatory_defaults.

Previous run

Review

Findings

Medium

  • [scope-exceeded] scripts/post-triage.sh:22 — The modifications to scripts/post-triage.sh exceed issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479's explicitly authorized scope. The issue authorizes changes to scripts/post-code.src.sh, scripts/post-code-test.sh, and re-bundling scripts/post-code.sh only. Changes at lines 22–25 (sourcing labels.lib.sh), line 81 (adding ensure_label call in add_label), and the removal of the inline gh label create for pr-open (lines 309–311 in base) are not authorized. Per AGENTS.md rule 3: "Every changed line in your diff must trace directly to the issue scope."
    Remediation: Remove all changes to scripts/post-triage.sh and scripts/post-triage-test.sh. If these scripts need the same fix, file a separate issue.

  • [protected-path] scripts/ — All 6 changed files (scripts/lib/labels.lib.sh, scripts/post-code-test.sh, scripts/post-code.sh, scripts/post-code.src.sh, scripts/post-triage-test.sh, scripts/post-triage.sh) are under the scripts/ protected path. The PR links to issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479 which authorizes changes to these scripts. Human approval is always required for protected-path changes regardless of context.

Low

  • [over-engineering] scripts/lib/labels.lib.sh:14_label_defaults defines defaults for 17 labels when only ready-for-review is needed for issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479's authorized scope. The remaining 16 label definitions have no usage in authorized changes.

  • [inconsistent-label-metadata] scripts/lib/labels.lib.sh:16 — Label descriptions in _label_defaults add a "Fullsend:" prefix not present in existing inline gh label create calls. Since ensure_label does not use --force, existing labels will not be overwritten, creating divergence between new labels (with prefix) and existing ones (without prefix).

Previous run (2)

Review

Findings

Medium

  • [scope-exceeded] scripts/post-triage.sh:81 — The modifications to scripts/post-triage.sh exceed issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479's explicitly authorized scope. The issue scopes changes to scripts/post-code.src.sh and scripts/post-code-test.sh (plus re-bundling scripts/post-code.sh). Changes at lines 22–25 (sourcing labels.lib.sh), line 81 (adding ensure_label to add_label), and the removal of the inline gh label create for pr-open (lines 309–311 deleted) are not authorized. Per AGENTS.md rule 3: "Every changed line in your diff must trace directly to the issue scope."
    Remediation: Remove all changes to scripts/post-triage.sh and scripts/post-triage-test.sh from this PR. If consolidating label creation logic across scripts is desired, file a separate issue.

  • [protected-path] scripts/ — All 6 changed files (scripts/lib/labels.lib.sh, scripts/post-code-test.sh, scripts/post-code.sh, scripts/post-code.src.sh, scripts/post-triage-test.sh, scripts/post-triage.sh) are under the scripts/ protected path. The PR links to issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479 which authorizes changes to these scripts. Human approval is always required for protected-path changes regardless of context.

Low

  • [API-contract-mismatch] scripts/lib/labels.lib.sh:43 — Issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479 carries forward a review finding suggesting gating the create-on-missing fallback on 404/422 stderr from the apply step. The current implementation calls ensure_label preemptively instead. While this deviates from the suggested retry-on-failure pattern, the preemptive approach avoids --force (no metadata clobbering), handles "already exists" silently, and achieves the same functional outcome. The extra API call per run is minor overhead.

  • [over-engineering] scripts/lib/labels.lib.sh:14_label_defaults defines defaults for 17 labels when only ready-for-review is needed for issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479's authorized scope. The remaining 15 label definitions have no usage in authorized changes.

  • [exit-code-contract-violation] scripts/post-code.src.sh:714 — Label application failure triggers exit 1 after the branch has been pushed and PR created. The script header documents exit code 1 as "validation failure or error (nothing pushed)." The exit 1 is required by issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479's review findings, but the exit code documentation should be updated to reflect the new semantics.

  • [inconsistent-variable-naming] scripts/post-triage.sh:22 — Variable name SCRIPT_DIR_TRIAGE deviates from the established SCRIPT_DIR_POST convention used in other post-scripts. (Moot if post-triage.sh changes are removed per scope-exceeded finding.)

  • [inconsistent-label-metadata] scripts/lib/labels.lib.sh:17 — Label descriptions in _label_defaults add a "Fullsend:" prefix not present in existing inline gh label create calls. Since ensure_label does not use --force, existing labels will not be overwritten, but the descriptions diverge from the established pattern.

Previous run (3)

Review

Findings

High

  • [error-handling-gap] scripts/lib/labels.lib.sh:52ensure_label unconditionally swallows all gh label create failures via 2>/dev/null || true. If the token lacks permission to create labels, or if there is a network/auth error, the function silently returns 0. The caller in post-code.src.sh then proceeds to gh issue edit --add-label, which may also fail because the label was never created. While the gh issue edit failure now correctly exits 1, the root cause (label creation failure) is invisible in logs.
    Remediation: Capture stderr from gh label create and log it when the command fails. E.g.: if ! err=$(gh label create "${create_args[@]}" 2>&1); then echo "Warning: gh label create failed: ${err}" >&2; fi; return 0

Medium

  • [fail-open] scripts/lib/labels.lib.sh:52ensure_label fires unconditionally before every label application, not gated on stderr of a failed gh issue edit --add-label as issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479 finding chore: update fullsend shim workflow #2 requires. The PR creates the label preemptively on every run rather than only when the apply step fails with a missing-label indicator (404/422). See also: [error-handling-gap] finding at this location.
    Remediation: Refactor to implement the issue-authorized pattern: attempt gh issue edit --add-label, capture stderr, inspect for missing-label indicators (404/422), only then call gh label create and retry.

  • [behavioral-escalation-risk] scripts/post-code.src.sh:696 — The gh issue edit --add-label call uses 2>/dev/null to suppress stderr, combined with the new exit 1 on failure. This makes the fatal error path uninformative — CI logs will only show "Failed to apply ready-for-review label" without the actual stderr from gh issue edit.
    Remediation: Capture stderr from gh issue edit instead of discarding it: if err=$(gh issue edit ... 2>&1); then ... else gha_echo error "Failed: ${err}"; exit 1; fi

  • [incomplete-migration] scripts/post-triage.sh:309ensure_label is called inside add_label, but an existing inline gh label create 'pr-open' --force at line ~312 still executes with --force and a different description ("An open PR already addresses this issue" vs "Fullsend: open PR addresses this issue" in _label_defaults). This creates redundant, conflicting label creation paths for pr-open.
    Remediation: Remove the direct gh label create 'pr-open' call since ensure_label inside add_label now handles label creation.

  • [scope-exceeded] scripts/post-triage.sh:81 — The modification to scripts/post-triage.sh exceeds issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479's authorized scope. The issue explicitly scopes changes to scripts/post-code.src.sh and scripts/post-code-test.sh. Per AGENTS.md rule 3: "Modify only what the issue authorizes."
    Remediation: Remove the ensure_label call from scripts/post-triage.sh and the labels.lib.sh source statement. If post-triage.sh needs label creation, file a separate issue.

  • [protected-path] scripts/ — All 5 changed files (scripts/lib/labels.lib.sh, scripts/post-code-test.sh, scripts/post-code.sh, scripts/post-code.src.sh, scripts/post-triage.sh) are under the scripts/ protected path. The PR links to issue Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo #479 which authorizes changes to these scripts. Human approval is always required for protected-path changes regardless of context.

Low


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@maruiz93
maruiz93 force-pushed the agent/479-label-create-on-missing branch from 0b13210 to 50c786e Compare July 31, 2026 10:10
@maruiz93

Copy link
Copy Markdown
Contributor

[error-handling-gap] — Addressed. ensure_label now captures stderr and logs unexpected failures (silences only "already exists"). Commit 50c786e.

[fail-open] — By design. The preemptive ensure_label call is intentionally simpler than a retry-on-fail pattern. The extra gh label create is a no-op when the label exists. Parsing gh issue edit stderr for 404/422 codes would be fragile and couple the lib to caller error handling. The issue authorizes fixing the missing-label problem, not a specific implementation pattern.

[behavioral-escalation-risk] — Addressed. gh issue edit stderr is now captured and included in the error message instead of being suppressed. Commit 50c786e.

[incomplete-migration] — Addressed. Removed the redundant inline gh label create 'pr-open' --force call — ensure_label inside add_label now handles it. Commit 50c786e.

[scope-exceeded] — The post-triage.sh change is authorized by @ifireball's review feedback ("I would expect to see some label application library function here used in all agents") and the issue's scope (provisioning required labels in target repos). The shared lib was the reviewer's explicit request.

[protected-path] — Acknowledged. Human review is in progress via @ifireball.

[over-engineering] — The 17-label table is intentional. The shared lib covers all known fullsend labels so other scripts can migrate to it incrementally, per the reviewer's "used in all agents" request.

[issue-requirement-not-addressed] — The PUSH_TOKEN already documents issues:write in the workflow file. Runtime token-permission verification is not standard practice for these scripts.

[inconsistent-label-metadata] — The pr-open inconsistency was resolved by removing the inline call (see [incomplete-migration]). The remaining inline calls in other scripts (post-review, post-fix, pre-code) are not modified by this PR — migrating them is a follow-up.

[source-directive-variable] — Addressed. Renamed _TRIAGE_SCRIPT_DIRSCRIPT_DIR_TRIAGE to match the SCRIPT_DIR_POST convention. Commit 50c786e.

@maruiz93
maruiz93 force-pushed the agent/479-label-create-on-missing branch 2 times, most recently from 5cba679 to aca34a5 Compare July 31, 2026 10:21
@maruiz93
maruiz93 requested a review from ifireball July 31, 2026 10:30
@maruiz93

Copy link
Copy Markdown
Contributor

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:33 AM UTC · Completed 10:51 AM UTC
Commit: aca34a5 · View workflow run →

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review July 31, 2026 10:51

Superseded by updated review

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Jul 31, 2026
@maruiz93
maruiz93 force-pushed the agent/479-label-create-on-missing branch from aca34a5 to 9f8c520 Compare July 31, 2026 11:03
@maruiz93

Copy link
Copy Markdown
Contributor

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:07 AM UTC · Completed 11:24 AM UTC
Commit: 9f8c520 · View workflow run →

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Squad — 3 agents (Claude x2, Grok), MEDIUM+ findings

Posting only findings that are new — deduped against the 8 existing comment threads and the 3 prior bot review rounds. Every finding below was verified against the code at 9f8c520 before posting; agent-reported findings that turned out to be false positives, already-resolved, or already-declared-intentional were dropped.

6 inline comments posted: 1 critical, 2 high, 3 medium.

The headline is the critical one on scripts/post-triage.sh:24: the source of scripts/lib/labels.lib.sh from a non-bundled runtime script violates the invariant this repo documents in its own README.md:55, and will abort triage on every enrolled repo. CI cannot catch it — check-bundle skips non-BUNDLE_SRCS scripts and shellcheck runs with -e SC1091. That finding and the post-triage.sh:81 one together mean the open CHANGES_REQUESTED is still unresolved: the code does not implement the mandatory/optional split described in the reply to it.

Two additional medium items without a clean inline anchor

[medium] premature-decision — the hardcoded colours contradict the live label set. Scoped to colours only; the description-prefix half of this is already settled as intentional and I'm not reopening it. Against gh api repos/fullsend-ai/agents/labels:

label live on this repo _label_defaults
ready-for-review a81af5 0E8A16
ready-to-code ededed 0e8a16
blocked / feature / needs-info / triaged all ededed e11d48 / a2eeef / d876e3 / c2e0c6

No issue, PR comment, or reviewer specified these values — they were chosen, not derived, and nothing pins them. Newly provisioned repos will also get mixed casing for the same green (0e8a16 vs 0E8A16 for the identical colour). Suggest deriving from the existing inline call sites, which are the de-facto spec, or recording where each value came from.

[medium] premature-decision — the token-permission answer cites the wrong token. Issue #479 step 3 asks to verify the coder-role token has Issues write for gh label create. The reply cited PUSH_TOKEN / the workflow permissions: block, but those govern the default GITHUB_TOKEN; the post-script actually receives steps.app-token.outputs.token, minted by .github/actions/mint-token with role: coder, whose permission set lives in the App configuration and cannot be granted or documented by a permissions: block. Probably fine in practice — POST /repos/{o}/{r}/labels and POST .../issues/{n}/labels share the same fine-grained Issues permission, and --add-label already works — but it was reported as verified when it wasn't, and ensure_label degrades a 403 to a warning, so if the coder role is read-only for label creation the symptom is the same silent non-dispatch #479 set out to fix.

Not re-flagged (settled in prior rounds)

scope-exceeded on post-triage.sh; preemptive ensure_label vs 404/422 gating; the 17-label count; the exit-code doc comment; SCRIPT_DIR_TRIAGE naming; the "Fullsend:" description prefix; the swallowed gh label create stderr (resolved in 50c786e).

Where a new finding lands near a settled thread, the inline comment says explicitly how it differs.

Verified as correct (no action)

local err on its own line followed by if ! err=$(...) correctly preserves exit status — no local-masking bug. if defaults=$(_label_defaults ...) is set -e-safe as an if condition. The include guard [[ -n "${LABELS_LIB_SH_LOADED:-}" ]] && return 0 is safe at top level of the bundle when the variable is unset (reproduced). The literal tabs in the %%/## splits are genuinely present and survive bundling intact. create_args is a proper array expanded as "${create_args[@]}", so repo and label names carry no injection risk. make check-bundle passes and post-code.sh is byte-exact.

Comment thread scripts/post-triage.sh Outdated
Comment thread scripts/post-triage.sh Outdated
Comment thread scripts/post-code.src.sh Outdated
Comment thread scripts/post-code-test.sh Outdated
Comment thread scripts/lib/labels.lib.sh
Comment thread scripts/lib/labels.lib.sh Outdated
@maruiz93
maruiz93 force-pushed the agent/479-label-create-on-missing branch from 9f8c520 to 0891505 Compare August 18, 2026 01:24
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 1:25 AM UTC · Ended 1:31 AM UTC

Commit: 0891505 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:32 AM UTC · Completed 1:50 AM UTC

Commit: 936b43b · View workflow run →

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Comment thread scripts/post-triage.src.sh
Comment thread scripts/post-retro.sh
Comment thread scripts/lib/labels.lib.sh
Comment thread scripts/post-retro.sh Outdated
Comment thread scripts/lib/labels.lib.sh
Comment thread scripts/lib/labels.lib.sh
Comment thread scripts/lib/labels.lib.sh Outdated
Comment thread scripts/lib/labels.lib.sh Outdated
…abels

Shared library that creates mandatory dispatch labels (ready-for-review,
ready-to-code, ready-for-triage) without --force, preserving admin
customizations. Non-mandatory labels are silently skipped.

Includes unit tests covering: mandatory create, non-mandatory no-op,
already-exists silence, error warning, defaults, REPO fallback, no --force.

Signed-off-by: Marta Anon <manon@redhat.com>
…st-code

Calls forge_ensure_label before forge_add_label so the label is created
on repos where it doesn't exist yet. Fixes silent dispatch failure on
newly enrolled repos.

Signed-off-by: Marta Anon <manon@redhat.com>
…triage

Calls forge_ensure_label before the deferred forge_add_label so
ready-to-code is created on repos where it doesn't exist yet.

Signed-off-by: Marta Anon <manon@redhat.com>
Preserves admin label customizations by handling 'already exists'
silently instead of overwriting with --force on every run.

Signed-off-by: Marta Anon <manon@redhat.com>
Use 'true > file' instead of '> file' to clear the calls file,
avoiding shellcheck warning about redirections without a command.

Signed-off-by: Marta Anon <manon@redhat.com>
@maruiz93
maruiz93 force-pushed the agent/479-label-create-on-missing branch from 936b43b to 207896f Compare August 18, 2026 01:52
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure · Started 1:54 AM UTC · Completed 1:55 AM UTC

Commit: 207896f · View workflow run →

Neutralize GHA workflow command sequences (::, %0A, %0D) in error
output from gh label create, matching the sanitization pattern used
elsewhere in the repo (e.g. SAFE_TITLE in post-retro.sh).

Signed-off-by: Marta Anon <manon@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure · Started 2:03 AM UTC · Completed 2:04 AM UTC

Commit: 3d31c5c · View workflow run →

Rename include guard LABELS_LIB_SH_LOADED → LABELS_SH_LOADED and
private function _mandatory_label_defaults → _labels_mandatory_defaults
to match the established <STEM>_SH_LOADED and _<lib>_<name> patterns.

Signed-off-by: Marta Anon <manon@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure · Started 2:09 AM UTC · Completed 2:10 AM UTC

Commit: b2d17f7 · View workflow run →

@maruiz93
maruiz93 added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit 107b558 Aug 18, 2026
25 of 29 checks passed
@maruiz93
maruiz93 deleted the agent/479-label-create-on-missing branch August 18, 2026 09:08
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 18, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 9:10 AM UTC · Completed 9:23 AM UTC

Commit: b2d17f7 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #481 — create-on-missing fallback for ready-for-review label

Lifecycle: 21 days (2026-07-28 to 2026-08-18). Code agent created the PR in 7 minutes, but the entire output was discarded — the branch was 212 commits behind main due to forge abstraction and bundling changes. A human (maruiz93) rewrote the PR from scratch twice after a team sync established the mandatory-vs-optional label design. 8 review rounds total (4 succeeded, 1 cancelled, 3 failed due to infrastructure).

Key findings

1. Code agent output: 0% survival. All original commits were force-pushed away. Root cause was a stale branch base in a fast-moving repo. This pattern is extensively tracked by existing issues: agents#697, agents#235, agents#565, fullsend#1741, fullsend#3308.

2. Review quality gap — bundling invariant. The automated review produced 17 findings (1 high, 5 medium, 11 low) focused on naming, scope, and documentation. A human Review Squad found 6+ findings (1 critical, 2 high, 3+ medium) focused on behavioral and semantic bugs. The critical finding — post-triage.sh sourcing a library file that would not exist at runtime — was exclusively human-discovered. The bundling invariant is documented in README.md but absent from AGENTS.md (the agent-facing guidance file). One proposal follows.

3. Review agent had relevant guidance but didn't apply it deeply. The code-review skill's "Runtime mechanism verification" section (line 89) already says to "trace the full path from where the mechanism is set to where it is read" and check failure paths. The bot found exit-code-contract-violation at LOW but missed the behavioral consequence (unreachable assignment, bypassed ERR trap) that the Review Squad escalated to HIGH. This supports agents#420 (review agent should verify technical assertions against source code).

4. Infrastructure failures. Runs 32089798359, 32090327245, 32090781375 all failed due to sandbox proxy blocking api.github.com (HTTP 403). Transient infrastructure issue; auto-retry is tracked by fullsend#2711.

5. Persistent scope-exceeded re-raising. The review agent flagged scope-exceeded on post-triage changes across 3+ review rounds despite human justification each time. Related to fullsend#3907 (incorporate PR conversation context into review verdict).

6. Design discussion needed pre-coding. ifireball noted this retro-agent-suggested change required team discussion before implementation. agents#605 (human-approval gate before auto-dispatch) would have prevented the wasted code agent run.

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Triggers review agent dispatch requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port fullsend PR 5657 (ready-for-review label create-on-missing) to the live post-code.sh in this repo

3 participants