Skip to content

feat(projects): import a GitHub epic as a project — platform half (abilityai/trinity-enterprise#1163) - #4494

Merged
vybe merged 11 commits into
devfrom
feature/1163-epic-import
Nov 14, 2026
Merged

vybe merged 11 commits into
devfrom
feature/1163-epic-import

Conversation

@vybe

@vybe vybe commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes abilityai/trinity-enterprise#1163

What

Platform half of abilityai/trinity-enterprise#1163: a person can import a GitHub epic as a project from the project import dialog. It is a one-time import, never a sync. The enterprise half (read, import, duplicate guard, route) is abilityai/trinity-enterprise#1250.

  • GitHubService.list_sub_issues (09eb34f55): a GET-only read of an issue's native sub-issues, one level deep.
  • A non-JSON 200 from an issue read now raises GitHubError(status=200) (eb2035cee, review I2), so the import answers 503 github_unreachable and writes nothing.
  • Frontend (214e5e4b0): a source switch in ProjectImportModal.vue (folder or GitHub epic), store and utils.
  • Docs: docs/user-docs/sharing-and-access/workspace-projects.md.
  • The enterprise submodule pin moves to 7e33e6b, the tip of abilityai/trinity-enterprise#1250.
  • Merges live dev (b85f9d1d4); the docs say an imported project begins Not started and open sub-issues arrive to do (6a3164418).

Review + security

  • Reading review (ent#1163 #issuecomment-6818988148): MERGEABLE, 0 critical. /cso --diff: nothing at ≥8/10.
  • Fixed after review on this side: I2 (eb2035cee). I1, I3 and the optional same-key pin are enterprise-side.

Tests

  • Evidence sweep (ent#1163 #issuecomment-6819288316): GREEN, 32 platform files shuffled, 27 vitest specs; named mutations went red.
  • Fix step: test_1163_github_sub_issues.py 23 passed (-p no:randomly).
  • workspaceProjectsEnt1163.mount.spec.js covers the import dialog switch.
  • All checks at 6a3164418 terminal and green on base dev. Validation: round 3 APPROVE (#issuecomment-6854775692).

Before merge

🤖 Generated with Claude Code

Trinity Agent (trinity) and others added 8 commits November 12, 2026 00:01
…task tools (abilityai/trinity-enterprise#1240)

Checkpoint B (platform). GitHubService.get_issue: one GET to
/repos/{o}/{r}/issues/{n} over a bounded client (5 s, one redirect),
GitHubError carries status, reset and rate_limited; network errors never
carry httpx's text. create_project_task gains refs, update_project_task
gains refs_add/refs_remove, and both now forward only the keys they
declare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ore and docs (abilityai/trinity-enterprise#1240)

Checkpoint C (platform).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…yai/trinity-enterprise#1240)

C1: GitHubService.issue_client adds a request hook that raises GitHubError
(status None -> the refs read records "unreachable") when a redirect hop's
scheme, host or port differs from API_BASE's, before that hop is sent, so
the platform token never leaves the API host.

I2: the Projects GitHub owners setting says removing an owner stops new
reads and titles already read stay as last read.

Bumps src/backend/enterprise to 6925b6e (C2 + I1).

Tests: test_redirect_to_another_origin_is_refused_before_it_is_sent and
test_redirect_changing_scheme_or_port_is_refused[x2] — red with the hook
removed, green restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s 6925b6e, on top of a03a9d3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…issue's sub-issues (ent#1163)

One paged GET /repos/{o}/{r}/issues/{n}/sub_issues on the bounded issue
client: 100 per page, the next page requested by number only while GitHub
sends rel="next" (no URL from a response is requested), capped at limit.
Non-200s share get_issue's error mapping (status, reset, rate_limited), now
one helper; a network error never carries httpx's text (#4284).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ent#1163)

ProjectImportModal gets one source switch, a radio group: 'From an agent'
(the folder import, unchanged, the default) and 'From a GitHub epic' (one
field for owner/repo#N or the issue link, pre-validated with a named
error and an example, and a note that it is a one-time copy that writes
nothing back to GitHub). A clean import opens the project; one that left
sub-issues out, hit the 100 cap, could not link a task or met nested
sub-issues names them first. Server refusals show inline in their own
words. store.importEpic posts { epic } to /import/epic and refreshes the
list. The projects user guide gains a paragraph.

Mounted vitest spec workspaceProjectsEnt1163.mount.spec.js (10 tests,
all red against the previous modal and store).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tus=200) (ent#1163 review I2)

get_issue and list_sub_issues called response.json() bare, so a proxy's
HTML page answering 200 surfaced as a ValueError no caller maps, and the
import route answered a bare 500. Both now raise GitHubError with
status=200, which callers already map to 'unreachable'.

Red before the fix: test_a_non_json_200_is_a_github_error_with_status_200
(both parametrizations, JSONDecodeError).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a2 (abilityai/trinity-enterprise#1163)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vybe vybe added the ui PR touches the frontend UI — triggers Playwright e2e tests label Nov 12, 2026
@trinity-ability

Copy link
Copy Markdown
Contributor

PR Validation Report

PR: #4494 — feat(projects): import a GitHub epic as a project — platform half (abilityai/trinity-enterprise#1163)
Author: vybe · Branch: feature/1163-epic-import (fe81d3c) → feature/1240-task-external-links (0ee2d15, PR #4490), not dev (stacked, as the rider says)
Files: 8 (+638/−37) · Lane C (enterprise pin 6925b6e→f8bd5a2) · no schema flag · Draft

Category Status Notes
Commit messages ✅ 4 conventional commits (feat ×2, fix, chore)
Base branch ⚠️ Targets #4490's branch by design; retarget to dev after #4490 merges
PR size ✅ 8 files
Status auto-promotion ✅ Fixes abilityai/trinity-enterprise#1163, cross-tracker, so set status-in-dev by hand after merge
Journey Impact ✅ check_journey_impact.py exit 0 ("no Journey Impact declared — allowed for now")
Requirements / Architecture ➖ Enterprise feature; design doc is in ent#1250 (WORKSPACE_PROJECTS_DESIGN.md)
Feature flows ➖ User doc updated (workspace-projects.md); no new public flow, as doc-routing requires
Security §4.1–4.10 ✅ Only hit is TOKEN = "ghp_TESTTOKEN1163", a test fixture under tests/ that doesn't match the real-token shape; no IP, email, host-path, mode or symlink; enterprise-docs-guard grep clean
Infra / build / config packaging ➖ No Dockerfile or compose change, no new backend dir, no new env var
Audit rows §4.11 ➖ audit_rows.py → "no gated write handler touched" (the route is in ent#1250)
Structural review ✅ Reading review (ent#1163 #issuecomment-6818988148, 0 critical) + /cso --diff (nothing ≥8/10) per PR body. The rider's ~/.claude/plans/1163-epic-import-review.md does not exist in this container
Merge gate ⚠️ Not satisfiable yet: PR-side runs green (build, e2e, gitleaks, guard, prod-image-smoke, schema-parity, verify-non-root), but on a non-dev base pytest (head) / regression diff / journey-smoke did not run. dev-ci: success (all Tier 2 green); no open dev-ci red issue
Test adequacy ✅ Non-happy paths covered: non-200, rate-limit on page 2, off-origin redirect, hostile Link URL, token never in error text, non-list/non-JSON body, bad args
Cross-surface drift §5.5 ✅ No router changed; no agent-server twin of github_service.py
Code quality ✅ Minimal; get_issue's error mapping lifted into _issue_json/_issue_error and reused, not copied
Product fit ✅ (noted) ent#1163 still status-incubating, but the operator put it in this chain (rulings #issuecomment-6817311812) and moves the label at merge
Bar 7–11 ✅ Agent route + MCP import_epic held, waiting on operator ask approval-YwOx0vQkKwmTDEc-ZMgeVg-1163-agent-import (T1), and the body names it; ratchets green (rawColor + loadingGate specs, 20 passed)

Execution coverage (§5.4)

symbol / file executed by live consumer verdict
GitHubService.list_sub_issues test_1163_github_sub_issues.py (23, real method over MockTransport) ent backend/projects/refs.py:400 @f8bd5a2 (read_epic) ✅
_issue_json / _issue_error (I2 fix) test_a_non_json_200_…[get_issue, list_sub_issues] github_service.py:182-183, 245-246 ✅
ProjectImportModal epic path workspaceProjectsEnt1163.mount.spec.js (mounted, jsdom) ProjectsList.vue:105 (@imported → open p.id); ent imports.py:396 returns id,name,tasks,unlinked,skipped,truncated,nested, which the dialog reads ✅
store.importEpic same spec, store.importEpic block posts to ent router.py:145 POST /import/epic ✅

Fix mutation (this run): removed the try/except in _issue_json → 2 red (test_a_non_json_200_is_a_github_error_with_status_200[get_issue|list_sub_issues]), 21 green; restored → 23 green. The evidence sweep only reached 214e5e4, so this covers the later fix commit eb2035c.

Issues

Critical: none.
Warnings / before merge:

  1. Retarget to dev after feat(projects): GitHub refs on project tasks — read path, MCP fields, task modal (abilityai/trinity-enterprise#1240) #4490 (and ent#1243) merge, then wait for Tier 1 on the PR, including pytest (head) + regression diff. Lane C also needs journey-smoke and frontend-e2e on the PR (e2e passed; journey-smoke hasn't run yet).
  2. Re-pin src/backend/enterprise to the commit ent#1250 squashes to on enterprise main. f8bd5a2 is a branch tip.
  3. The PR body's Before merge list leaves out two items from the rulings: U3 (the live read-owners allowlist must cover Abilityai before a private epic imports) and U6 (one live read of a public epic with sub-issues). Carry them here or on ent#1250.
  4. PR is still a draft, and status-incubating is on ent#1163. Both are operator steps at merge.
    Suggestion: list_sub_issues (like get_issue) puts owner/repo into the URL without validating them and relies on the caller (refs.parse_ref, _OWNER_RE/_REPO_RE). It's safe today because the only caller validates. A guard in the service would be defence in depth; it's optional.

Not run (by design): the full platform, enterprise and vitest suites. The evidence sweep ran them (#issuecomment-6819288316, 32/33/27 green), so I didn't repeat them. ent#1250 is validated separately.

Recommendation: APPROVE (conditional on the before-merge sequence above)

Validated against base feature/1240-task-external-links @0ee2d15 (stacked on #4490), not dev.

🤖 Generated with Claude Code

@vybe
vybe changed the base branch from feature/1240-task-external-links to dev November 13, 2026 13:02
Trinity Agent (trinity) and others added 2 commits November 13, 2026 08:18
The base PR trinity#4490 was squash-merged (a080d6c); files only it touched
take dev's side. Real conflicts keep both intents: the user doc (dev's
project-mode text + the GitHub-epic paragraph and one-way line) and the
projects store's export list (importEpic). Enterprise gitlink → 7e33e6b (the
ent#1163 branch tip, merged with ent main; contains dev's pin 6b1de6d).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ues to do (ent#1163)

Review C2/W1 on the user doc: the import creates a not_started project and
open sub-issues import as todo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trinity-ability

Copy link
Copy Markdown
Contributor

PR Validation Report — trinity#4494, round 3 (run chain-ent1236, delta fe81d3c..6a31644)

Head 6a3164418 · base dev (6bbff0d87 = live tip) · gitlink src/backend/enterprise = 7e33e6b (ent#1250 head) ✅

Decision: APPROVE (draft; not marked ready, per the rider)

check status evidence
Merge of live dev ✅ b85f9d1d4 merges 6bbff0d87. git diff origin/dev...6a3164418 = 8 files, +638/−37. Against fe81d3c1d, github_service.py, ProjectImportModal.vue, the mount spec and test_1163_github_sub_issues.py are byte-identical. The only hunks that left projectsUtils.js / stores/projects.js are the #1240 ref helpers, which landed on dev through #4490
C2/W1 user doc ✅ docs/user-docs/sharing-and-access/workspace-projects.md:26: open sub-issues arrive to do, closed done; the project begins Not started until Start project. Matches imports.py and the design doc at 7e33e6b
Closing keyword ✅ Fixes abilityai/trinity-enterprise#1163. Cross-tracker, so set status-in-dev by hand after merge
Checks ✅ All terminal: 22 pass, 5 skipping. Includes journey-impact, journey-smoke, e2e, regression diff, pytest (head), gitleaks, prod-image-smoke, schema-parity and verify-non-root. dev-ci on dev = success
Security greps (delta) ✅ none

Warnings (update before merge, not code)

Not run

No tests re-run (per rider). No §5.5 or audit-script re-run: the delta is docs plus the gitlink.

PR #4494 — APPROVE — merge gate: ✅

@vybe
vybe marked this pull request as ready for review November 13, 2026 13:48
…0's squash commit c10d8c6 (Abilityai/trinity-enterprise#1163)

Mechanical, per the merge-train note on the PR. dev's pin (710c8ae, #4533) and this branch's
(7e33e6b, the ent#1250 branch tip) both give way to the commit that landed on enterprise main.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vybe

vybe commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

merge-train 2026-11-14 — pushed to this branch (mechanical): e7edb1b84 merges live dev (f89e30bf4, which carries #4533's pin) and re-points src/backend/enterprise from the ent#1250 branch tip 7e33e6b to c10d8c6, the commit ent#1250 squashed to on enterprise main. The submodule was the only conflict; no other file changed (git diff origin/dev is still this PR's 8 files, +638/−37). The new pin also carries ent#1208 and ent#1262, whose platform halves (#4426, #4539) are already on dev. Merging once the checks on e7edb1b84 are green.

@trinity-ability trinity-ability left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge-train 2026-11-14: round 3 APPROVE at 6a31644; delta to e7edb1b is the dev merge plus the enterprise re-pin to c10d8c6 only. All checks green at e7edb1b. Approved at Gate 1.

@vybe
vybe merged commit 8479a1d into dev Nov 14, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants