Commit Graph
195 Commits
Author SHA1 Message Date
claude b5cd1559f4 Merge remote-tracking branch 'upstream/main' into chore/upstream-sync-20260227 2026-02-27 11:58:44 +00:00
Vlad MocanuandClaude Opus 4.6 c97c9765c3 fix: allow Forgejo bot actor on non-comment events
The self-trigger guard blocked the claude bot on all events. Loop risk
only exists for comment/review events (tag mode). PR, workflow_dispatch,
and schedule events are safe — refined the guard to only block on
issue_comment, issues, pull_request_review, and
pull_request_review_comment events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:57:59 +02:00
Vlad MocanuandClaude Opus 4.6 2978878d82 fix: pass allowed_tools to SDK in agent mode
Agent mode never passed ALLOWED_TOOLS_INPUT to the Claude SDK —
only tag mode did (via --allowedTools in claudeArgs). This meant
the allowed_tools action input was silently ignored in agent mode,
causing all Bash commands to require interactive approval in CI.

Pass ALLOWED_TOOLS_INPUT directly as options.allowedTools, which
the SDK merges with any tools from claudeArgs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 12:58:09 +02:00
Vlad MocanuandClaude Opus 4.6 ed536bb8a3 feat: add human-readable CI log output for show_full_output mode
Replace raw JSON dumps with concise, scannable log lines when
show_full_output is enabled. Adds an onMessage callback to the SDK
runner that formats each message type into 1-2 line summaries with
emoji prefixes, tool-specific parameter display, result correlation
for parallel tool calls, and subagent progress tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 12:50:49 +02:00
Vlad MocanuandClaude Opus 4.6 df7afc08d4 fix: wire allowed_tools/disallowed_tools inputs through to Claude SDK
The disallowed tools env var read in run.ts was DISALLOWED_TOOLS_INPUT
(raw user input) instead of DISALLOWED_TOOLS (computed value including
WebSearch/WebFetch defaults). This meant default tool disallowance was
never enforced. Also removes orphaned ALLOWED_TOOLS env var export from
createPrompt() (tag mode passes allowed tools via claudeArgs instead),
extracts shared parseToolsInput utility to eliminate duplication, and
adds tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:16:38 +02:00
GitHub Actions 1dd74842e5 chore: bump Claude Code to 2.1.61 and Agent SDK to 0.2.61 2026-02-26 22:39:58 +00:00
Vlad MocanuandClaude Opus 4.6 29a1032aa6 fix: normalize Forgejo PR/issue state to uppercase
Forgejo REST API returns state as lowercase ("closed"/"open") but
branch.ts compares against GraphQL-style uppercase ("CLOSED"/"MERGED").
This caused @claude on closed/merged PRs to take the open-PR checkout
path, failing with "fatal: invalid reference: refs/pull/N/head".

Normalize state to uppercase in the Forgejo data fetcher, matching the
existing pattern used for review state (line 153).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:19:53 +02:00
Vlad MocanuandClaude Opus 4.6 2e1165ed90 fix: handle Forgejo pull_request_comment payload missing pull_request field
Forgejo's pull_request_comment event uses an issue_comment-like payload
with issue.number instead of pull_request.number. Add fallback to
extract entity number from issue field when pull_request is absent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:31:40 +02:00
Vlad MocanuandClaude Opus 4.6 741f12afaf fix(prd-7): M5 code quality review — remove dead re-exports, verify type safety
- Removed unused re-exports (CommentUpdateInput, ExecutionDetails,
  ensureProperlyEncodedUrl) from forgejo/comment-logic.ts
- Verified no `any` type escapes in Forgejo-specific code
- Confirmed naming conventions consistent with upstream
- No dead code, unused imports, or unreachable branches
- All complex decisions documented with comments
- Typecheck, format, and 834 tests pass clean

Progress: 83% complete — M6 (documentation accuracy) remaining

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 12:57:25 +02:00
Vlad MocanuandClaude Opus 4.6 6b0302d226 fix(prd-7): M3 security review — self-trigger guard, actor permissions, trigger bypass, platform validation
- Add self-mention/bot loop prevention in actor.ts (blocks actor matching bot_name)
- Switch Forgejo permission check to actor-level via getCollaboratorPermissionLevel
  with fallback to token-level repos.get() when collaborator API returns 403
- Close empty-body PR review comment trigger bypass (now returns false instead of true)
- Add platform detection cross-validation (reject PLATFORM=forgejo on github.com)
- Document URL builder defense-in-depth rationale in comment-logic.ts
- Update/add tests across 6 test files (actor, permissions, trigger, platform, mcp, m7)

Progress: 50% complete (3/6 milestones) — next: M4 test coverage review

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 12:31:12 +02:00
Vlad MocanuandClaude Opus 4.6 cefc229199 fix(prd-7): M2 error handling review — fix process.exit bypasses, TOCTOU gap, URL consistency
- F1: Replace process.exit(1) with throw in branch.ts (cleanup was bypassed)
- F2: Replace process.exit(1) with throw in install-mcp-server.ts (same issue)
- F2b: Replace process.exit(1) with throw in create-prompt/index.ts (same issue)
- F3: Use getServerUrl() instead of GITHUB_SERVER_URL constant in branch-cleanup.ts
- F4: Use updated_at for review TOCTOU filtering in Forgejo data fetcher
- Accepted notes: no pagination >100, no retry, unconditional trigger, image no-op

Progress: 33% complete — M2 done, M3 (security review) next

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 12:16:22 +02:00
Vlad MocanuandClaude Opus 4.6 ac58fb6c14 fix(prd-7): M1 architecture review — consolidate duplication, fix bugs, memoize detection
- F1: Consolidated updateForgejoCommentBody into unified updateCommentBody (~150 lines removed)
- F2: Fixed wrong run identifier in update-with-branch.ts (context.runId → getForgejoRunIndex())
- F3: Memoized detectPlatform() with _resetPlatformCache() for tests
- F4: Added getServerUrl() runtime helper to resolve constant-vs-function inconsistency
- F5: Fixed sticky comment bot matching on Forgejo via context.inputs.botName
- F6: Documented GHES heuristic misidentification in docs/forgejo.md
- Updated PRD M1 checkbox to complete

Progress: 17% complete — M1 done, M2 (error handling review) next

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 12:09:02 +02:00
Vlad Mocanu ae326659b1 Merge remote-tracking branch 'upstream/main' 2026-02-26 11:36:32 +02:00
Vlad MocanuandClaude Opus 4.6 2acaece6ae fix: use expand=1 instead of quick_pull=1 in PR URL on Forgejo
The prompt template hardcoded quick_pull=1 (GitHub-specific) in the
"Create a PR" URL. On Forgejo, this parameter is ignored so the
compare page doesn't auto-expand the PR creation form. Forgejo uses
expand=1 for this purpose.

Since Claude writes the PR URL into the comment body, and
updateForgejoCommentBody() extracts it (prLinkFromContent) with
priority over the URL generated by update-comment-link.ts, the
prompt template is the correct place to fix this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:32:53 +02:00
Vlad MocanuandClaude Opus 4.6 99624efacc fix: fall back to issue.assignee on Forgejo for assignee trigger
Forgejo's issues/assigned webhook payload doesn't include a top-level
assignee object. The assignee is only available under issue.assignee.
Fall back to that field when payload.assignee is missing.

Also removes M5 debug logging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:47:30 +02:00
Vlad MocanuandClaude Opus 4.6 001072c05c debug: add issue.assignee/assignees logging for M5
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:46:25 +02:00
Vlad MocanuandClaude Opus 4.6 9efd06cc26 debug: add M5 debug logging for assignee trigger
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:15 +02:00
Vlad MocanuandClaude Opus 4.6 71fb686885 fix: gate Forgejo review/comment triggers on @claude mention
Previously, all pull_request_comment events on Forgejo triggered the
full Claude pipeline unconditionally — both in the workflow if-condition
and in trigger.ts. This wasted CI resources and API credits on reviews
without @claude mentions (e.g. plain "LGTM" reviews).

Workflow: add @claude check via contains() on comment.body and review.body.
Trigger validation: replace blind auto-trigger with payload-aware check
that inspects available body fields, falling back only when no body exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:09 +02:00
Vlad MocanuandClaude Opus 4.6 84cf34ff1f fix: route Forgejo review comment updates to issue comment API
On Forgejo, the tracking comment for pull_request_review_comment events
is always created as a regular issue comment (because Forgejo's webhook
payload lacks the top-level comment object). The MCP server was
incorrectly setting isPullRequestReviewComment=true based on the event
name, causing every update to try pulls.updateReviewComment first —
which 404'd and silently swallowed Claude's responses.

Three fixes:
- MCP server: detect Forgejo and always use issue comment path
- update-comment-link: skip pulls.getReviewComment on Forgejo (saves
  one wasted 404 API call)
- update-claude-comment: expand fallback to also catch 422 (defense
  in depth for Forgejo edge cases)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:09 +02:00
Vlad MocanuandClaude Opus 4.6 a6b3c94004 fix: use dependency injection for image-downloader fs mocks
mock.module("fs/promises") on Linux Bun poisons the entire mock
tracking system — not just fs mocks, but ALL mock/spy assertions
(octokit mocks, spyOn(global, "fetch"), etc.) stop recording calls.

Replace with dependency injection: downloadCommentImages() now accepts
an optional fsDeps parameter. Tests pass mock mkdir/writeFile directly.
Production callers omit it and get real fs. No mock.module anywhere.

Fixes 18 test failures blocking CI on Forgejo Linux runners.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:08 +02:00
Vlad MocanuandClaude Opus 4.6 3cd73bccde revert: remove label check from opened events to prevent duplicates
Forgejo fires both issues/opened AND issues/label_updated when an
issue is created with a label. Having the label check on opened
caused duplicate Claude runs. Remove it — the label_updated event
handles label triggers correctly now that the workflow gate and
action normalization are fixed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:30:47 +02:00
Vlad MocanuandClaude Opus 4.6 1feec26c2e feat: check trigger label on issue opened events
When an issue is created with the trigger label already applied,
Forgejo only fires issues/opened (not a separate labeled event).
Check payload.issue.labels for the trigger label during opened
events so creating an issue with the claude label works in one step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:29:05 +02:00
Vlad MocanuandClaude Opus 4.6 b37009b766 cleanup: remove M4 debug logging from run.ts
Debug logging confirmed Forgejo sends 'label_updated' as eventAction
for issues/labeled events. Normalization fix in context.ts handles it.
Remove temporary debug lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:27:59 +02:00
Vlad MocanuandClaude Opus 4.6 baa007a3ec fix: normalize Forgejo 'label_updated' to 'labeled' in context
Forgejo sends eventAction 'label_updated' instead of 'labeled' for
issue label events. Add FORGEJO_EVENT_ACTION_MAP in context.ts to
normalize at parse time (same pattern as event name normalization),
so all downstream code (trigger.ts, create-prompt) works unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:25:58 +02:00
Vlad MocanuandClaude Opus 4.6 fa0070ddcc fix: accept Forgejo 'label_updated' action for label triggers
Forgejo sends eventAction 'label_updated' instead of 'labeled'
for issue label events (discovered via debug logging, run 52786).
Accept both values in trigger.ts label check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:24:01 +02:00
Vlad MocanuandClaude Opus 4.6 b020426956 debug: add issues event payload logging for M4 label trigger
Temporary debug logging to inspect eventAction and payload.label
on Forgejo for issues/labeled events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:22:57 +02:00
Vlad MocanuandClaude Opus 4.6 dab92ef0eb fix: use mock.module for image-downloader tests
Replace the _fsForTest/DI patterns with Bun's native mock.module() API.
This mocks fs/promises at the module loader level, which works reliably
on Linux where jest.fn() call tracking fails cross-module. The source
code is now clean with no testing artifacts.

Also switches from jest.fn() to mock() (Bun's native API) for Octokit
mocks in these tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:05:39 +02:00
Vlad MocanuandClaude Opus 4.6 cff360d00a fix: use dependency injection for image-downloader fs mocks
The _fsForTest mutable object pattern fails on Linux Bun because
test and source files get different module instances. Switch to
passing fs operations as an optional parameter with defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 08:54:58 +02:00
Vlad MocanuandClaude Opus 4.6 ac8e22e2f8 fix: fall through to issue comment when PR review comment fetch 404s
On Forgejo, pull_request_review_comment events create the tracking
comment as a regular issue comment (because the payload lacks
comment.id for reply-to-review). The update-comment-link step then
tried pulls.getReviewComment() first, which 404'd and threw before
reaching the issues.getComment() fallback.

Wrap the PR review comment fetch in its own try/catch so it falls
through to the issue comment fetch on failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 08:49:26 +02:00
Vlad MocanuandClaude Opus 4.6 e73c881c64 fix: skip commentBody validation for Forgejo review comment events
Forgejo's pull_request_review_comment payload doesn't include the
comment body. The Forgejo data fetcher retrieves it via REST instead.
Skip the COMMENT_BODY required check on Forgejo to avoid crashing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 08:42:22 +02:00
Vlad MocanuandClaude Opus 4.6 9d8c96f01e fix: handle missing comment payload in Forgejo pull_request_review_comment
Forgejo's pull_request_review_comment event does NOT include a top-level
`comment` object in the webhook payload. This caused crashes at:
- create-initial.ts: context.payload.comment.id (for reply-to-review)
- fetcher.ts: context.payload.comment.created_at (for trigger timestamp)

Fix: use optional chaining and fall back gracefully — reply-to-review
becomes a regular issue comment, trigger timestamp returns undefined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 08:39:48 +02:00
GitHub Actions 273fe82540 chore: bump Claude Code to 2.1.59 and Agent SDK to 0.2.59 2026-02-26 01:05:07 +00:00
Vlad MocanuandClaude Opus 4.6 a10b0475c0 fix: handle missing comment payload in Forgejo review comment events
Forgejo's pull_request_review_comment event does not include a
top-level `comment` object in the payload (it's undefined), causing
a crash: "undefined is not an object (evaluating 'context.payload.comment.body')".

- trigger.ts: On Forgejo, always trigger for pull_request_review_comment
  events since the workflow already gates on event name alone
- create-prompt/index.ts: Use optional chaining for comment fields,
  fall back to actor/empty values (data fetcher provides full data)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 23:53:19 +02:00
Vlad Mocanu a129a15f61 feat(prd-6): verify workflow triggers and add assignee_trigger (#13) 2026-02-25 21:43:37 +00:00
GitHub Actions cd4b150a2a chore: bump Claude Code to 2.1.58 and Agent SDK to 0.2.58 2026-02-25 20:04:44 +00:00
Vlad Mocanu 3bab2edc41 fix: build image URL regexes at call time, not module load time 2026-02-25 19:26:18 +00:00
Vlad MocanuandClaude Opus 4.6 23f15aecb9 fix: use GITHUB_RUN_NUMBER for Forgejo job URLs and pin Bun version in CI
Forgejo uses the per-repo sequential run index (GITHUB_RUN_NUMBER) in
action URLs, not the internal DB run ID (GITHUB_RUN_ID). This caused
"View job" links to return 404. Fixed in all 4 URL construction sites:
create-initial comment, update-comment-link, and both prompt generators.

Also pins Bun to 1.2.21 in CI — Bun 1.3.9 broke spyOn(fs, ...) which
failed 18 upstream image-downloader tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 21:07:40 +02:00
Vlad MocanuandClaude Opus 4.6 b03ccb518c feat(prd-5): add dedicated claude-bot user for Forgejo
- Add bot_email action input for custom git commit email on Forgejo
- Update claude.yml to use CLAUDE_BOT_TOKEN with bot_id/bot_name/bot_email
- Update git-config.ts to use provided email over noreply format
- Add "Dedicated Bot User" setup guide to docs/forgejo.md
- Update CLAUDE.md with bot identity documentation

Infrastructure (done outside code):
- claude-bot user created (ID 48, non-admin, with avatar)
- Claude team with write access in all 12 orgs
- CLAUDE_BOT_TOKEN org-level secret in all 12 orgs

Progress: ~85% complete - pending E2E validation after merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:56:55 +02:00
Vlad MocanuandClaude Opus 4.6 b4a6c34853 fix: use per-review comment fetching for Forgejo compatibility
Forgejo doesn't have the flat GET /pulls/{number}/comments endpoint
(returns 404). Replace pulls.listReviewComments() with a 2-phase
approach: fetch reviews first, then pulls.listCommentsForReview()
per-review in parallel. Updates tests to mock the new per-review API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:52:25 +02:00
Vlad MocanuandClaude Opus 4.6 87b7fec838 fix: use repos.getBranch() on Forgejo for branch SHA lookup
Forgejo uses /git/refs (plural) not /git/ref (singular), causing
git.getRef() to 404. Use repos.getBranch() on Forgejo instead,
which returns the same SHA data via a compatible endpoint.

Also adds the tag mode workflow (.forgejo/workflows/claude.yml)
for @claude mentions on issues, PR reviews, and label triggers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:02:24 +02:00
Vlad Mocanu ead98f44f9 fix(prd-1): skip actor check on Forgejo (no bot accounts, avoids read:user scope) 2026-02-25 19:40:24 +02:00
Vlad MocanuandClaude Opus 4.6 638645b8af fix(prd-1): handle undefined actor type on Forgejo
Forgejo's user API doesn't return a `type` field (GitHub returns
"User" or "Bot"). The undefined type was incorrectly treated as
non-human, blocking all Forgejo workflows. Now treat undefined/empty
type as human — Forgejo doesn't have GitHub-style bot accounts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:41:14 +02:00
Vlad MocanuandClaude Opus 4.6 e26d08e666 fix(prd-1): fix CI test failures and Forgejo permission check
Two issues found during M8 E2E testing on Forgejo:

1. CI test failures (31 tests): Unit tests assume GitHub context but
   Forgejo runner sets GITHUB_SERVER_URL=git.wxs.ro, causing
   detectPlatform() to return "forgejo" and module-level constants in
   config.ts to use Forgejo URLs. Fixed by setting GITHUB_SERVER_URL
   in the test step env. Forgejo-specific tests already override with
   PLATFORM=forgejo in their beforeEach.

2. Permission check 403: Forgejo's getCollaboratorPermissionLevel
   requires admin access. Added checkForgejoPermissions() that uses
   GET /repos/{owner}/{repo} instead — returns a permissions object
   with { admin, push, pull } booleans for the authenticated token.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:39:18 +02:00
Vlad MocanuandClaude Opus 4.6 88401255be feat(prd-1): implement M7 - entry point + mode handler integration
- Tag mode routes to fetchForgejoData vs fetchGitHubData based on platform
- createInitialComment auto-detects platform for Forgejo spinner/URL format
- update-comment-link uses updateForgejoCommentBody + Forgejo PR compare URL
- update-with-branch uses platform-aware branch/job-run link formatting
- Agent mode needed NO changes (token in run.ts, rest uses Octokit REST)
- 11 new integration tests in test/m7-integration.test.ts
- 785 tests pass, typecheck clean, format clean

Progress: 78% complete (7/9 milestones) - M3, M8, M9 remaining

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:22:27 +02:00
Vlad MocanuandClaude Opus 4.6 ce1459fe7f feat(prd-1): implement M6 - MCP server platform routing
- Add platform detection to prepareMcpConfig() via detectPlatform()
- Skip GitHub public MCP server (ghcr.io/github/github-mcp-server) on Forgejo
- Skip checkActionsReadPermission on Forgejo (workflow token has full access)
- Reuse existing github-actions-server.ts for both platforms (no duplication)
- Add 6 Forgejo-specific tests to install-mcp-server.test.ts
- Updated PRD checkboxes for M6

Progress: 67% complete (6/9 milestones) - M7 now unblocked

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:57:35 +02:00
Vlad MocanuandClaude Opus 4.6 0802ac18eb feat(prd-1): implement M5 - Forgejo comment URL formatting
- Create src/forgejo/comment-logic.ts with Forgejo-specific URL builders:
  - Unicode spinner (replaces GitHub CDN image)
  - PR compare URL with expand=1 (no quick_pull=1)
  - Dynamic extractOwnerRepoFromUrl() fixing hardcoded github.com regex
  - updateForgejoCommentBody() with cross-platform URL extraction
- 41 tests covering all URL patterns, spinner, and the critical regex fix
- No upstream files modified (lean adapter approach)

Progress: 56% complete (5/9) - next: M6 (MCP server platform routing)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:48:16 +02:00
Vlad MocanuandClaude Opus 4.6 4b0737c54c feat(prd-1): implement M4b - Forgejo REST comment/review fetching
- Add 3 REST calls to Promise.all for PRs (listComments, listReviews,
  listReviewComments) and 1 for issues (listComments)
- Add mapping helpers: mapRestComments, mapRestReviewComments,
  mapRestReviews (groups inline comments by pull_request_review_id)
- Import and apply TOCTOU filtering (filterCommentsToTriggerTime,
  filterReviewsToTriggerTime) and actor filtering from GitHub fetcher
- Add image processing pipeline via downloadCommentImages (no-op on
  Forgejo due to URL pattern mismatch, architecturally correct)
- Deep-clone reviews before filtering to preserve contextData immutability
- Update test suite: 51 tests covering mapping helpers, full fetch
  flow, TOCTOU filtering, actor filtering, and contextData immutability
- Updated PRD checkboxes for M4b completion

Progress: 44% complete (4/9 milestones) - next: M5 or M3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:00:13 +02:00
Vlad MocanuandClaude Opus 4.6 6e104a33dc feat(prd-1): implement M4a - Forgejo REST data fetching (PR/issue basics)
- Add src/forgejo/data/fetcher.ts: REST-based data fetcher replacing
  GraphQL queries with parallel Octokit REST calls (PR details + files
  + commits via Promise.all, issue details, file status mapping, SHA
  computation, TOCTOU title/body protection, user display name)
- Add test/forgejo-data-fetcher.test.ts with 31 test cases covering
  field mapping, parallel fetch, null handling, and edge cases
- Output matches FetchDataResult type for downstream compatibility
- Comments/reviews left empty (M4b scope)

Progress: 33% complete (M1, M2, M4a done) - next: M4b or M5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:19:09 +02:00
Vlad MocanuandClaude Opus 4.6 385acacc32 feat(prd-1): implement M2 - Forgejo token handling
- Add src/forgejo/token.ts: synchronous token handler that returns
  OVERRIDE_GITHUB_TOKEN or DEFAULT_WORKFLOW_TOKEN directly (no OIDC)
- Wire platform-aware token setup into run.ts with early branch
  before existing setupGitHubToken() call
- Add test/forgejo-token.test.ts with 8 test cases covering
  override precedence, default fallback, and error handling
- GitHub token path remains completely unchanged

Progress: 22% complete (M1, M2 done) - next: M3 (CI workflows) or M5 (comment URLs)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:10:00 +02:00
Vlad MocanuandClaude Opus 4.6 72f11f320c feat(prd-1): implement M1 - platform detection and action.yml modifications
- Add src/platform/detector.ts with 3-tier detection (explicit input,
  FORGEJO env var, GITHUB_SERVER_URL heuristic)
- Add 'platform' input to action.yml (auto/github/forgejo)
- Add 'Detect Platform' shell step as first composite action step
- Split bun installation: oven-sh/setup-bun for GitHub, curl fallback
  for Forgejo runners
- Condition 'Revoke app token' step to skip on Forgejo
- Pass resolved PLATFORM env var to run step
- Add 14 unit tests covering all detection paths

Progress: M1 complete (1/9 milestones) - M2 and M5 now unblocked

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:03:51 +02:00