Commit Graph

82 Commits

Author SHA1 Message Date
c870efa15a port fix
All checks were successful
port-to-omp / verify (push) Successful in 7s
port-to-omp / publish (push) Successful in 6s
2026-08-12 14:13:14 -04:00
100262b94f feat: hang detection and resumable task sessions
Some checks failed
port-to-omp / port (push) Failing after 4s
- runAgentSession gains an inactivity watchdog (execution.inactivityTimeoutMs,
  default 0 = off): when no session event arrives within the window, the
  session is aborted (agent abort + bash subprocess kill) with a clear
  "inactivity timeout" error
- agent sessions persist to .ralpi/sessions/*.jsonl; resume reopens the
  JSONL via SessionManager.open so an interrupted task continues with its
  prior conversation instead of restarting from scratch
- progress.json tracks sessionFile per task (persisted at session creation,
  so kill/reload mid-run is resumable); the first attempt after resume
  reuses it, failover retries stay fresh; corrupt/missing files fall back
  to a fresh session with a warning
- bump version to 0.6.0
2026-08-12 12:55:44 -04:00
c2525a6411 fix: skip agent spawn on zero-conflict merges; carry prior review context across passes
- resolveConflictsSession: guard against reattemptMerge returning
  clean=false with zero unmerged paths (branch already merged, dirty
  index, stale ref). Previously fell through to spawning a full agent
  session with no conflicts to resolve. Now tries completeMerge or
  aborts without spawning.

- Review-gated loop: accumulate rejected reviews in a priorReviews
  array and inject them into buildReviewPrompt via a new
  ReviewPromptOptions.priorReviews field. The reviewer now sees prior
  findings and can verify they were addressed instead of re-reviewing
  from scratch each pass. Added renderPriorReviews() helper and wired
  it into both buildReviewPrompt and buildReviewPromptUncommitted.
2026-08-12 12:07:48 -04:00
85438c4a3e workflow: Gitea-canonical auth (Mike:<token>), PORTING_KEY everywhere, workflow_dispatch, preflight auth check
Some checks failed
port-to-omp / port (push) Failing after 5s
2026-08-11 09:09:15 -04:00
5466630dbd workflow: fail loudly on missing PORTING_TOKEN before trimming (set -u safe) 2026-08-10 21:53:07 -04:00
5e7cee15e3 workflow: trim PORTING_TOKEN (paste newlines break oauth2 auth) + fail loudly when missing
Some checks failed
port-to-omp / port (push) Failing after 2s
2026-08-10 16:44:52 -04:00
7594ca06f5 port: stub omp README (omp install + source link); source README install via npm
Some checks failed
port-to-omp / port (push) Failing after 4s
2026-08-10 16:07:29 -04:00
890988b72c port: refuse dst inside src (realpath-normalized) + workflow clones omp repo outside checkout
All checks were successful
port-to-omp / port (push) Successful in 16s
2026-08-10 15:56:46 -04:00
540862d7d0 rename Actions secret to PORTING_TOKEN (GITEA_/GITHUB_ prefixes are reserved)
Some checks failed
port-to-omp / port (push) Failing after 7s
2026-08-10 15:29:06 -04:00
cb35ee044c add port-to-omp.mjs + Gitea Actions workflow (regenerate omp port on push)
Some checks failed
port-to-omp / port (push) Failing after 6s
2026-08-10 12:24:15 -04:00
3b586ea92d remove legacy skills/ralpi-use.md and its manifest wiring 2026-08-10 10:47:39 -04:00
7ef6e3d9a2 feat: compact vs. verbose chat settings 2026-08-09 20:18:22 -04:00
25e76679c5 feat: git ignore ralpi 2026-08-09 15:34:12 -04:00
d31fca3cb3 finished better review prep (better execution capture of git) 2026-08-09 15:23:01 -04:00
c29fdd750a test: cover file-list + read instruction for oversized review diffs 2026-08-08 19:27:24 -04:00
b86174782f feat: add per-file +/− summary and noise-filtered scope to review prompts
Emit a ### Changed Files Markdown table (| File | +/− | Type | rows plus
total added/removed) ahead of the raw diff in both committed and
uncommitted review prompts, parsed from the diff via the shared
parseDiff engine. Add an ### Excluded Files (n) section listing filtered
noise (path, +/− counts, reason), and replace byte-truncation of oversized
diffs with a file-list + read instruction when the cleaned diff exceeds
50KB or touches more than 20 files.

Also: distinguish diff-computation failure from genuinely no changes in the
review loop (tri-state result, never treats a broken base ref as a clean
verified task), map critical→blocker in finding severity parsing, inject a
per-review custom focus/instructions section from config, and make the
noise-filter ignore rules project-configurable via review.extraIgnorePatterns
and review.ignorePaths. Add same-model retry before cycling to the next
model in task/follow-up/fix sessions.
2026-08-08 18:10:08 -04:00
88f6b4df93 feat: port noise-filtered diff parsing engine
Add src/diff.ts: a reusable unified-diff engine that parses diffs into
per-file +/− stats and filters noise (lockfiles, minified/generated
assets, source maps, snapshots, build output, node_modules/vendor,
binary/media) so review prompts feed only clean, review-relevant changes.
Exports DiffSummary/FileDiff shapes, EXCLUDED_PATTERNS, isExcluded,
parseDiff, plus filterNoise and configurable extra-pattern/ignore-path
overrides. Malformed diff chunks are skipped without crashing, and
excluded files are never double-counted into totals.

Add tests/diff.test.ts covering the included/excluded split, per-file
+/− counts, totals excluding noise, malformed-chunk guard, and the
noise-filter override rules.
2026-08-08 16:45:31 -04:00
723b7be84a change: send down proj context with pi tool/skills 2026-08-05 10:58:05 -04:00
bed74f9d33 Make /ralpi-reset select the loop to reset like resume 2026-08-03 20:18:54 -04:00
3a3c293aa7 bump 2026-08-03 17:13:52 -04:00
b9a12931fe fix: resume selection under-reports task totals with multiple loops
The resume prompt counted total/completed from progress.tasks, which only
records TOUCHED tasks (started/completed/failed) — never-started tasks were
silently missing, and file-checkbox completions weren't counted unless
markCompleted had run. With e.g. 10 tasks where 3 completed and 5 untouched,
it showed 3/5 done instead of 3/10 done.

- add countPRDResumeStats (src/utils.ts): total from parseTaskFile of the
  PRD source; completed = progress completions ∪ PRD checkbox completions,
  deduped by task id; failed from progress. Falls back to touched-task
  counts when the source file is missing/unparseable.
- selectPRDToResume (index.ts) uses the helper instead of Object.keys().
- tests/resume-stats.test.ts: 4 regression tests.

Includes pre-existing uncommitted changes: index.ts tab-reformat (matches
src/ style) and package.json version bump 0.4.2 -> 0.4.3.
2026-08-03 16:31:09 -04:00
f9b57ec2ed fix flaky resume behavior 2026-08-02 23:36:35 -04:00
b0749467c9 fix: updated docs to align with reality 2026-08-02 16:54:27 -04:00
f361f05f96 version bump 2026-08-02 16:43:42 -04:00
9f1250d1a1 fix: ralpi-plan properly loads task-manager prompt 2026-08-02 16:43:08 -04:00
fc2f8a879f bump 2026-07-31 09:58:22 -04:00
7253e51fb9 feat: use stored review on resume if interrupted 2026-07-31 09:57:51 -04:00
284b3720af breaking:drop command part path 2026-07-31 09:57:40 -04:00
d7c3962bc8 fix: include prompt in ralpi-plan 2026-07-30 08:39:02 -04:00
6223ac84a5 feat: register subcommands, finalize-on-resume, reuse loop snapshot
- Register /ralpi-run, /ralpi-plan, /ralpi-resume, /ralpi-reset as
  separate Pi commands (dash namespace). /ralpi kept as back-compat
  dispatcher.
- /ralpi-resume now reuses mode + loop options from loop-active.json
  so interrupted loops resume non-interactively (only prompts when no
  snapshot exists).
- Add finalizeCommittedWorktrees in worktree.ts; resumeLoop calls it at
  start to merge already-completed task branches into main (the classic
  interrupted-between-commit-and-merge crash window), leaving dirty/
  conflicted worktrees for re-run.
- Switch process.cwd() -> ctx.cwd in all command handlers.
2026-07-28 15:14:11 -04:00
dd61249e8d version bump 2026-07-23 17:52:49 -04:00
a0973ae1d2 fix: resume no longer clears worktrees 2026-07-22 23:30:31 -04:00
6dcbd064a6 fix: review skipped silently when task diff exceeds 1MB maxBuffer
getCommitRangeDiff and getLatestCommitDiff had maxBuffer set to 1MB.
When a task produced a larger diff (common for 10+ minute tasks),
execSync threw, the catch block returned null, and the review loop
broke immediately with no message — reviews were silently skipped for
larger tasks while smaller tasks reviewed fine.

- Increase maxBuffer to 10MB in both functions (the review prompt
  builder already truncates to MAX_DIFF_BYTES = 50KB before sending
  to the model, so the full diff in memory is fine)
- Add a diagnostic sendChatMessage when the review loop is skipped
  (baseRef undefined or no diff), so silent skips are visible
2026-07-22 21:53:29 -04:00
74c9ead7af fix: review fires for all tasks — commit then review committed diff, merge on pass
Previous flow reviewed uncommitted changes, so when a task agent
self-committed its work the review was silently skipped (no uncommitted
changes → review loop body never entered). This caused reviews to fire
inconsistently across tasks.

New review-gated flow (when autoReview is on):
1. Execute task
2. Ensure committed — commit session fallback when the agent didn't
   self-commit (handles both self-commit and no-commit agents)
3. Review the COMPLETE task diff (baseRef..HEAD) captured before
   execution, so the reviewer sees all commits not just the latest
4. On fail → re-execute with feedback → commit → re-review (same
   baseRef, so reviewer sees complete state including fixes)
5. On pass → merge worktree (all changes already committed)

Commit is now mandated when autoReview is on (autoCommit forced true,
not asked at startup). autoCommit only asked when autoReview is off.

Add captureGitHead + getCommitRangeDiff helpers to utils.ts. Switch
review prompt from buildReviewPromptUncommitted to buildReviewPrompt
(reviewing committed changes, not uncommitted).
2026-07-22 18:29:29 -04:00
0ef540ed47 feat: review-gated loop triggers on autoReview alone, ask review before commit at startup
- Review now runs whenever autoReview is enabled (not only when both
  autoCommit && autoReview). On fail, the task re-executes with review
  feedback injected and loops until pass or maxReviewRetries exhausted.
- Commit after a passing review is gated by autoCommit; review-only mode
  leaves changes uncommitted for manual inspection.
- Remove legacy post-commit review path and unused imports
  (buildReviewPrompt, getLatestCommitDiff).
- Reorder selectLoopOptions: ask autoReview first, then saveReviews,
  then autoCommit (reworded to 'commit after a passing review' when
  review is enabled).
- Update types.ts doc comments and README to reflect new semantics.
2026-07-22 17:43:57 -04:00
9fcf944cb5 feat: per prd worktrees 2026-07-22 16:37:02 -04:00
0034272c54 feat: better branch titles 2026-07-22 11:17:24 -04:00
c46f8f1783 feat: batch-level conflict resolution for worktree merges
Add reattemptMerge/abortMerge/completeMerge/hasMergeConflicts helpers to
worktree.ts. When a worktree merge conflicts, executeTask now defers to
batch-level resolution instead of immediately marking the task failed.

After all tasks in a batch finish, resolveConflictsSession re-attempts the
merge to recreate the conflict state, spawns an agent session with
buildConflictResolutionPrompt to resolve conflict markers and commit, then
verifies completion. This keeps parallel task slots unblocked — conflicts
are resolved sequentially at the batch boundary.
2026-07-20 15:45:12 -04:00
46da29ee22 feat: separate workspaces per parallel execution 2026-07-20 12:27:22 -04:00
519b12b3d9 follow-up restructure.
- loop until review pass
- review now comes prior to commit
2026-07-20 10:29:15 -04:00
6aa3f6bd9f feat: persist full review output to disk and render in expandable view
Review text was truncated to 500 chars in the chat message body with no
way to access the full content — once a review exceeded that limit it was
lost from the UI. Now the full review body is rendered in the expanded
(Ctrl+O) view like the implementation tool-call tree, and can optionally
be persisted to disk per-loop.

Changes:
- Add saveReviews config flag + reviewsDir path option
- Add loop-start prompt to opt into saving reviews to disk when
  auto-review is enabled (skipped when explicitly set in YAML)
- Pass full reviewText via message details instead of inlining a slice
- Extend ralpi-progress renderer to show full review body when expanded,
  dim hint to expand when collapsed
- Add saveReviewToFile() writing to .ralpi/reviews/<prdKey>/<taskId>.md,
  mirroring the per-loop reflections layout so many loops don't collide
2026-07-17 16:03:53 -04:00
008489a91b fix: pass parent modelRuntime so extension providers work in ralpi sessions
ralpi's runAgentSession was letting createAgentSession create a fresh
ModelRuntime from models.json only. This excluded extension-registered
providers like neuralwatt, whose streamSimple wrapper handles:
- 429 rate-limit header parsing (concurrent/TPM/admission/RPM)
- Rate-limit error normalization for Pi's retry logic
- Context-overflow error normalization

Without the wrapper, neuralwatt rate-limit and context-overflow errors
surfaced as raw unrecoverable errors instead of being retried by Pi's
built-in retry. Now passes ctx.modelRegistry.runtime (the underlying
ModelRuntime) through to createAgentSession.
2026-07-17 11:11:21 -04:00
087c64ff18 fix: context overflow, retry, and reflection isolation
- Cap commit diffs in review/commit prompts at 50KB to prevent
  context window overflow on follow-up sessions
- Skip skills catalog (noSkills) in commit/review follow-up sessions
  for leaner context
- Wire Pi's SettingsManager into runAgentSession so Pi's built-in
  retry (exponential backoff, provider retry) applies to ralpi
  sessions — removes ralpi's duplicate manual retry loop
- Remove maxRetries/retryDelayMs from ralpi config; rely on Pi's
  retry.* settings (with manual override support)
- Remove retries field from progress.json and incrementRetry() from
  ProgressTracker
- Add model failover to follow-up sessions (commit/review cycle
  through the model pool on connection errors)
- Namespace reflection files by PRD key under
  .ralpi/reflections/<prdKey>/ so task sets don't overwrite each
  other
- Skip loop-startup prompts for config fields explicitly set in YAML
- Remove (default) annotations from loop options prompts
- Default commitTimeoutMs/reviewTimeoutMs to 0 (inherit Pi defaults)
2026-07-17 09:02:44 -04:00
6c398eef64 live reporting commit requests, resume prints batching 2026-06-23 13:31:37 -04:00
496d1554be version bump 2026-06-21 13:30:39 -04:00
fe28718911 feat: support for letter padded tasks 2026-06-21 13:29:24 -04:00
3ba5fcb098 fix copyright year 2026-06-19 12:42:47 -04:00
db8859606f handles phased tasks 2026-06-09 13:59:38 -04:00
85123b7755 fixed regressed parsing, tool sanitation 2026-06-08 20:34:16 -04:00
dc3993048e commit clarification 2026-06-04 09:29:00 -04:00