Skip to content

refactor(#1108): use OpenShell providers for Jira credentials - #1109

Open
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/1108-jira-provider-credentials
Open

refactor(#1108): use OpenShell providers for Jira credentials#1109
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/1108-jira-provider-credentials

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Converge triage and code Jira overlays on provider-backed credential delivery so the real JIRA_TOKEN never enters either sandbox — only the jira-ro provider's opaque placeholder is available to sandboxed Jira clients.
  • Remove runner-side .issue-context.json prefetch from the code agent; the sandbox now reads Jira work items directly through the provider boundary via curl.
  • Add harness-jira-test.sh verifying provider/profile selection and token absence from sandbox configuration for both agents.

Changes

Harness configuration:

  • harness/triage.yaml — remove JIRA_TOKEN from env.sandbox (provider supplies placeholder)
  • harness/code.yaml — attach providers/jira-ro.yaml and profiles/fullsend-jira-ro.yaml; remove host_files prefetch and credential env vars from env.runner; add JIRA_USER_EMAIL and JIRA_BASE_URL to env.sandbox
  • env/jira/triage.env — remove JIRA_TOKEN export (was expanded into sandbox via expand: true)

Scripts:

  • scripts/pre-code-jira.src.sh — remove credential requirements and issue-fetch logic; retain URL validation and pre-commit tool installation
  • scripts/pre-code-jira.sh — rebuilt via make script-build

Skills and docs:

  • skills/code-implementation/SKILL.md — update Jira issue fetching to use provider-backed API access instead of .issue-context.json
  • docs/code.md — update FULLSEND_TRACKER description and Jira-source overlay documentation
  • docs/triage.md — document provider-backed credential delivery in Jira setup and migration notes

Tests:

  • scripts/harness-jira-test.sh (new) — verifies provider/profile presence, JIRA_TOKEN absence from sandbox config, and related assertions for both triage and code harnesses
  • scripts/pre-code-jira-test.sh — updated for simplified pre-script (removed prefetch/credential tests, added tests confirming credentials are no longer required)

Testing

  • bash scripts/harness-jira-test.sh — 17/17 pass
  • bash scripts/pre-code-jira-test.sh — 8/8 pass (source and bundled modes)
  • make check-bundle — pass
  • hack/lint-agent-docs — pass
  • scan-secrets — pass
  • Pre-existing post-retro-test.sh failures (16) are unrelated

Closes #1108

Post-script verification

  • Branch is not main/master (agent/1108-jira-provider-credentials)
  • Secret scan passed (gitleaks — c4879824d5045bfb8c64527a74e620332e18d95a..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

Converge both triage and code agents on provider-backed Jira API
access so the real JIRA_TOKEN never enters either sandbox. The
jira-ro provider injects an opaque placeholder at the HTTP layer;
sandboxed curl calls authenticate through the provider boundary
instead of using the real secret.

Triage harness: remove JIRA_TOKEN from env.sandbox and
env/jira/triage.env. The provider (already attached) supplies the
placeholder. Runner-side post-scripts retain the real token via
env.runner for trusted mutations.

Code harness: attach providers/jira-ro.yaml and the
fullsend-jira-ro OpenShell profile. Remove the runner-side
.issue-context.json prefetch — the sandbox reads Jira work items
directly via the provider boundary. Remove JIRA_ISSUE_CONTEXT_FILE,
JIRA_USER_EMAIL, and JIRA_TOKEN from env.runner (no longer needed).
Add JIRA_USER_EMAIL and JIRA_BASE_URL to env.sandbox (non-secret
config for API calls).

Pre-script: strip credential requirements and issue-fetch logic
from pre-code-jira.src.sh, keeping URL validation and pre-commit
tool installation.

Skill: update code-implementation to query Jira directly via curl
instead of reading .issue-context.json.

Tests: add harness-jira-test.sh verifying provider/profile
selection and JIRA_TOKEN absence from sandbox config. Update
pre-code-jira-test.sh for the simplified pre-script.

Note: shellcheck could not run (not available in sandbox).
pre-commit hooks could not fetch remote repos (network policy);
ran equivalent checks directly. Pre-existing post-retro-test.sh
failures (16) are unrelated to this change.

Closes #1108
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:04 PM UTC · Completed 10:26 PM UTC

Commit: 8812312 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Aug 31, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 31, 2026

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Anchored to prior assessment (score 2). Only LOCAL.md documentation changed since last review; Tier 1 signals unchanged — same file count (11), same protected-path count (7), same bot author, same dependency status. No articulable reason to change the score.

Previous run

Risk Assessment: moderate (2/5)

Details

Moderate file count (10) with 7 protected-path changes (harness/, scripts/, skills/), but bot author, same-day triaged issue, clear acceptance criteria coverage, and security-focused credential boundary refactor mitigate risk.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] harness/code.yaml, harness/triage.yaml, scripts/harness-jira-test.sh, scripts/pre-code-jira-test.sh, scripts/pre-code-jira.sh, scripts/pre-code-jira.src.sh, skills/code-implementation/SKILL.md — 7 files under protected paths (harness/, scripts/, skills/) are modified. The PR links to issue refactor(jira): use OpenShell providers for triage and code credentials #1108 and explains the rationale (converging on provider-backed credential delivery). Human approval is required for protected-path changes regardless of context.

Low

  • [incomplete-credential-removal] harness/triage.yaml:111JIRA_TOKEN remains in the triage overlay's runner env block. The runner-side presence is architecturally justified: pre-triage.sh and post-triage.sh execute on the runner and require the real credential for Jira API mutations (label writes, transitions, comment posting). The code agent fully removed JIRA_TOKEN from its runner env because it has no post-script Jira mutations. This asymmetry is by design per issue refactor(jira): use OpenShell providers for triage and code credentials #1108 acceptance criteria ("Runner-side triage mutations can continue to use the real credential where needed").

  • [credential-exposure] skills/code-implementation/SKILL.md:222 — The curl --user "${JIRA_USER_EMAIL}:${JIRA_TOKEN}" pattern places the provider's opaque token placeholder in process arguments within the sandbox. Under enforcement: enforce in the fullsend-jira-ro profile, the OpenShell proxy intercepts the request and substitutes the real credential at the HTTP layer, so the placeholder is not the actual secret.

  • [defense-in-depth] scripts/pre-code-jira.src.sh:28 — The pre-script's required-env-var guards for JIRA_ISSUE_CONTEXT_FILE, JIRA_USER_EMAIL, and JIRA_TOKEN are removed. With provider-backed delivery, a missing or misconfigured provider surfaces at runtime as an HTTP 401 from the Jira API inside the sandbox, rather than failing fast at pre-script time. The provider's credential resolution is the new validation gate.

Previous run

Review

Findings

Medium

  • [stale-reference] LOCAL.md:178 — LOCAL.md (lines 176–181) still describes the removed Jira prefetch pattern: "The Jira pre-script fetches the issue via the fullsend CLI and writes the context to /tmp/jira-issue-context.json, which host_files copies into the sandbox as /sandbox/workspace/.issue-context.json." This is no longer accurate — the PR removes issue-context prefetching from pre-code-jira.sh and the host_files entry from code.yaml.
    Remediation: Update lines 176–181 of LOCAL.md to describe the new provider-backed Jira API access pattern.

  • [protected-path] harness/code.yaml, harness/triage.yaml, scripts/harness-jira-test.sh, scripts/pre-code-jira-test.sh, scripts/pre-code-jira.sh, scripts/pre-code-jira.src.sh, skills/code-implementation/SKILL.md — 7 files under protected paths (harness/, scripts/, skills/) are modified. The PR links to issue refactor(jira): use OpenShell providers for triage and code credentials #1108 and explains the rationale (converging on provider-backed credential delivery). Human approval is required for protected-path changes regardless of context.

Low

  • [stale-reference] LOCAL.md:165 — The comment # Jira-source env vars (runner-only — never enter sandbox) is misleading: JIRA_USER_EMAIL and JIRA_BASE_URL now enter the code sandbox via env.sandbox, and JIRA_TOKEN is no longer needed for the code agent runner.
    Remediation: Clarify that JIRA_USER_EMAIL and JIRA_BASE_URL enter the sandbox for code runs, and JIRA_TOKEN is only needed for triage runner post-scripts.

  • [defense-in-depth] scripts/pre-code-jira.src.sh — The pre-script's required-env-var guards for JIRA_ISSUE_CONTEXT_FILE, JIRA_USER_EMAIL, and JIRA_TOKEN are removed. With provider-backed delivery, a missing or misconfigured provider will surface at runtime (HTTP 401) rather than failing fast at pre-script time. The provider's credential resolution is the new validation gate.

  • [credential-exposure] skills/code-implementation/SKILL.md — The curl --user "${JIRA_USER_EMAIL}:${JIRA_TOKEN}" pattern exposes the provider's opaque placeholder in shell history and process listings. The profile's enforcement: enforce mitigates the risk of real credential exposure.


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.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 10:28 PM UTC · Completed 10:34 PM UTC

Commit: 8812312 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.61

Update two stale references in LOCAL.md that still described the
removed runner-side Jira prefetch pattern:

- Line 165: Clarify that JIRA_USER_EMAIL and JIRA_BASE_URL now enter
  the code sandbox as non-secret config, while JIRA_TOKEN stays on the
  runner for post-script mutations.
- Lines 178–181: Replace the fullsend CLI / host_files / .issue-context.json
  description with the new provider-backed API access pattern.

Addresses #1109
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Fixed two stale references in LOCAL.md: updated the env var comment (line 165) to clarify which vars enter the sandbox, and replaced the prefetch description (lines 178–181) with the new provider-backed API access pattern. Disagreed with three informational findings: protected-path process note (no code fix needed), defense-in-depth observation (intentional design tradeoff), and credential-exposure note (mitigated by profile enforcement).

Fixed (2):

  1. LOCAL.md:178 still describes the removed Jira prefetch pattern (LOCAL.md): Updated lines 178–181 to describe the new provider-backed Jira API access pattern instead of the removed fullsend CLI / host_files / .issue-context.json prefetch.
  2. LOCAL.md:165 comment says runner-only but JIRA_USER_EMAIL and JIRA_BASE_URL now enter sandbox (LOCAL.md): Updated the comment to clarify that JIRA_TOKEN stays on the runner for post-script mutations while JIRA_USER_EMAIL and JIRA_BASE_URL enter the code sandbox as non-secret config for provider-backed API access.

Disagreed (3):

  1. 7 files under protected paths are modified and require human approval: This is an informational finding about process, not a code defect. The PR links to issue refactor(jira): use OpenShell providers for triage and code credentials #1108 and explains the rationale. Human approval for protected-path changes is a process requirement handled outside the fix agent.
  2. Removed env var guards in pre-code-jira.src.sh mean misconfigured providers surface at runtime: This is an intentional design tradeoff acknowledged by the reviewer: the provider's credential resolution is the new validation gate. The PR's purpose is to remove runner-side credential handling. Re-adding guards would contradict the migration. Additionally, scripts/ is a protected path.
  3. curl --user pattern in SKILL.md exposes provider placeholder in shell history: The reviewer notes the profile's enforcement: enforce mitigates the risk of real credential exposure. The opaque placeholder is by design — it is not the real secret. Additionally, skills/ is a protected path.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:35 PM UTC · Completed 10:54 PM UTC

Commit: 9d9e033 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.55

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review August 31, 2026 22:54

Superseded by updated review

@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.

Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • harness/triage.yaml (file-level): Line 111 · [low] incomplete-credential-removal

JIRA_TOKEN remains in the triage overlay's runner env block. The runner-side presence is architecturally justified: pre-triage.sh and post-triage.sh execute on the runner and require the real credential for Jira API mutations. This asymmetry with the code agent is by design per issue #1108 acceptance criteria.

@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.

exit 1
if [ "${FULLSEND_TRACKER:-}" = "jira" ]; then
ISSUE_KEY=$(echo "${ISSUE_URL}" | sed -E 's|.*/browse/||')
curl --fail-with-body --silent \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] credential-exposure

The curl --user pattern places the provider's opaque token placeholder in process arguments within the sandbox. Under enforcement: enforce, the OpenShell proxy intercepts and substitutes the real credential at the HTTP layer, so the placeholder is not the actual secret.

: "${JIRA_TOKEN:?JIRA_TOKEN must be set}"
: "${REPO_FULL_NAME:?REPO_FULL_NAME must be set}"

# Sanitize a value for safe use in GHA workflow commands (::error::, etc.).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] defense-in-depth

The pre-script's required-env-var guards for JIRA_ISSUE_CONTEXT_FILE, JIRA_USER_EMAIL, and JIRA_TOKEN are removed. With provider-backed delivery, a missing or misconfigured provider surfaces at runtime as an HTTP 401 rather than failing fast at pre-script time.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review requires-manual-review Review requires human judgment risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(jira): use OpenShell providers for triage and code credentials

1 participant