Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nullcache/corecoder-ts
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: nullcache/corecoder-ts
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: min
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 20 commits
  • 17 files changed
  • 3 contributors

Commits on Aug 15, 2026

  1. Configuration menu
    Copy the full SHA
    4694f48 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3a87ef4 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2026

  1. Update README for the min/dev branch split and current line counts

    Refresh the line-count claim (~2,600 src + ~850 test lines after the
    recent fixes), document the min/dev branch model, add the
    CORECODER_TIMEOUT_MS env var, describe the fixed-overhead calibration
    accurately, and list scripts/ in the layout.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    f21388b View commit details
    Browse the repository at this point in the history
  2. Address README review findings

    Drop the npm install command (package is not published), mark the
    Ollama quick start as needing a dummy key, scope the .env lookup claim
    to the home directory, soften the design-commentary claim, and reword
    the branch descriptions (min: kept as small as possible; dev:
    enhancements no longer bound by the minimal bar).
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    51b6c45 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #5 from uuzzrm/fix/readme-overhaul

    Overhaul the README: from one sentence to something you can actually use
    nullcache authored Aug 17, 2026
    Configuration menu
    Copy the full SHA
    f38a913 View commit details
    Browse the repository at this point in the history
  4. Fix --api-key help text and ship the MIT LICENSE file

    The --help usage string (and the README block mirroring it) claimed
    $OPENAI_API_KEY is the default key source, but config.ts resolves
    $CORECODER_API_KEY first. State the real precedence in both places.
    
    package.json has declared MIT since the initial commit, but no LICENSE
    file existed, so there was no actual grant text and GitHub reported the
    repository as unlicensed.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    e4d60a4 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #9 from nullcache/fix/cli-help-and-license

    Fix --api-key help text and ship the MIT LICENSE file
    nullcache authored Aug 17, 2026
    Configuration menu
    Copy the full SHA
    257c315 View commit details
    Browse the repository at this point in the history
  6. Fix eleven correctness bugs found in the source review

    P0 (data corruption / dead-on-install / documented-usage traps):
    - edit_file: replace via a function so $$/$&/$' in new_string are
      written literally instead of corrupting the file
    - CLI: realpath argv[1] before comparing to import.meta.url — npm bin
      symlinks made the installed command silently do nothing
    - Agent.chat: finally-backfill tool replies when a consumer abandons
      the generator (for-await break poisoned the history permanently)
    - SSE body phase: abort now cancels the reader (unblocks reads and
      closes the connection) and each read races an idle timer, so a
      stalled stream errors instead of hanging the turn forever
    
    P1 (hangs / silently wrong):
    - bash kill: SIGTERM now escalates to SIGKILL after a 5s grace, so a
      TERM-trapping child can't wedge the REPL; timer cleared on exit
    - tools: makeAllTools() factory — a second Agent no longer re-points
      the first Agent's shared SubAgentTool at itself
    - context: compression LLM calls take the turn's AbortSignal
    - llm: tool-call arguments parsing coerces null/array/scalar to {}
    - context: layer-0 truncation for a single message that alone exceeds
      the window (was an unrecoverable 413 loop)
    - glob: strip leading ./ and support [ch]/[!x] character classes
      (both silently matched nothing)
    - cwd: tracked cwd moved to paths.ts so every tool resolves relative
      paths against it, and cd parsing follows ;/|| chains too
    
    Adds 11 regression tests (54 total pass).
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    e427732 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    be0bf8a View commit details
    Browse the repository at this point in the history
  8. Address review: scope down and fix second-order bugs

    - Revert the cross-tool cwd unification and ;/|| parsing (magic state,
      out of min's scope — the split-brain stays a documented limitation)
    - Replace silent oversized-message truncation with an up-front refusal
      in Agent.chat (the truncation math ignored the fixed overhead and
      silently altered user input; refusing is honest and simpler)
    - Kill sequence now starts at most once (a second trigger orphaned the
      first SIGKILL escalation timer, which settle() could never clear)
    - rounds() closes the inner LLM generator in a finally, so abandoning
      a turn during text streaming cancels the SSE reader and releases the
      connection (hand-driven .next() gets no auto-close from yield*)
    - isDirectRun's catch falls back to a plain compare instead of
      silently refusing to start
    - Keep the [ch]/[!x] character classes: verified native in Python
      pathlib.glob — this is port parity, not added syntax
    
    Tests: drop the cwd case, add oversized-refusal and
    abandon-during-text-streaming-closes-connection. 54/54 pass.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    60aabec View commit details
    Browse the repository at this point in the history
  9. Address review round 2: await generator teardown, fnmatch-faithful cl…

    …asses
    
    - rounds() awaits stream.return() and sseEvents awaits reader.cancel():
      for-await's break waits on the return() chain, so teardown now
      completes before break returns, and a throwing inner finally surfaces
      as a handled rejection instead of an unhandled one. The regression
      test asserts closure immediately after break, no sleep.
    - Character classes now follow Python fnmatch semantics on the edges:
      ^ is a literal member (only ! negates), ] right after [ or [! is a
      literal member, and an invalid range like [z-a] matches nothing
      instead of throwing. The doc comment states the supported subset
      explicitly — no claim of a full glob dialect.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    ba3b405 View commit details
    Browse the repository at this point in the history
  10. Address final review: straight SIGKILL, drop input pre-check, usage h…

    …onesty
    
    - kill goes straight to SIGKILL on the whole process group: Python's
      subprocess.run timeout behavior (kill outright), hardened from the
      direct child to the group. The TERM->timer->KILL machinery is gone.
    - remove the oversized-input pre-check: it judged user input by an
      estimate and could refuse legitimate messages; the provider's own
      context error is the honest answer.
    - /tokens prints 'unknown' when the provider has never reported usage,
      instead of dressing unknown up as 0 (usageSeen on LLMClient).
    - write the token-accounting principle into context.ts, document the
      no-usage degradation on observe(), compress the sseEvents comments.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    ca763de View commit details
    Browse the repository at this point in the history
  11. Remove cost estimation (PRICING table and estimatedCost)

    Prices rot within months, the estimate multiplies a guessed token
    count by a guessed rate, and the table teaches nothing architectural.
    Token accounting stays — that is real provider data; only the money
    guess goes. Removing estimatedCost from LLMClient is a breaking
    change for library consumers, acceptable pre-1.0.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    5f3e538 View commit details
    Browse the repository at this point in the history
  12. Merge pull request #10 from nullcache/fix/source-review-bugs

    Fix eleven correctness bugs from the source review
    nullcache authored Aug 17, 2026
    Configuration menu
    Copy the full SHA
    cc4bf6a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    76e5234 View commit details
    Browse the repository at this point in the history
  14. Merge pull request #11 from nullcache/chore/remove-cost-estimation

    Remove cost estimation (PRICING table and estimatedCost)
    nullcache authored Aug 17, 2026
    Configuration menu
    Copy the full SHA
    ca8bfeb View commit details
    Browse the repository at this point in the history
  15. Fix calibration math, usage completeness, tool exports, stale tests

    Four follow-ups from the round-4 review of the merged fixes:
    
    - Calibration: measure() is now messageEstimate x ratio + fixedEstimate
      (and observe derives the ratio from real minus fixed). The blended
      formula multiplied the English fixed overhead by a CJK conversation's
      rate, overstating a compressed history by up to 2x the overhead
      (simulated: 565 vs a true ~232). Adds the mixed-rate regression test
      the old suite lacked.
    - Usage honesty: usageSeen only flips on actual numbers (a usage object
      with null fields is not data), and a new optional usageMissed flags
      responses that carried none, so /tokens now has three states:
      unknown / reported-but-incomplete / reported. The label says
      'Reported tokens' — no more claiming a complete total.
    - Tool exports: drop ALL_TOOLS and getTool (zero internal or test
      usage); the shared SubAgentTool instance they exposed reintroduced
      the cross-agent parent-stealing bug for library consumers. Only the
      makeAllTools factory remains.
    - npm test: clean runs first (portable node -e rm, no more rm -rf), so
      compiled remnants of deleted tests can no longer execute. Verified by
      planting a failing ghost test in dist/ — it no longer runs.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    fd88088 View commit details
    Browse the repository at this point in the history
  16. Shrink the model: static UTF-8-byte estimate, no calibration

    Replace the ratio-calibration subsystem with a stateless heuristic and
    a strict two-lane rule — the estimate drives pre-call decisions and is
    never calibrated; provider usage is post-hoc accounting and never
    feeds the estimate.
    
    - approxTokens = ceil(utf8Bytes / 3): ASCII lands at ~3 chars/token,
      CJK at ~1 char/token (3 bytes/char), and byte counting sidesteps
      UTF-16 surrogate pitfalls — no Unicode tables, no state.
    - delete ratio and observe() (and the agent call site); measure() is
      the plain estimate plus the fixed prompt/tool-schema overhead.
    - usage accumulates only when a chunk carries BOTH prompt and
      completion numbers; the incomplete mark now lands in a finally, so
      an aborted or torn-down stream flags the totals too (post-loop code
      never runs on teardown).
    - /tokens: 'Reported tokens: P / C (incomplete)' — three states,
      no total claim.
    - README: the three calibration passages now describe the byte
      estimate and the two-lane rule.
    - tests: calibration cases replaced by exact deterministic byte-math
      assertions; new partial-usage and aborted-stream-incomplete cases.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    d43ca8f View commit details
    Browse the repository at this point in the history
  17. Book usage in the same finally that marks completeness

    A stream could deliver the complete usage chunk and then die before
    [DONE]: the finally saw complete numbers (so no incomplete mark) while
    the accumulation after the loop was skipped by the teardown — a ledger
    claiming completeness with the numbers missing. Accumulation now lives
    in the finally: book the numbers when complete, mark incomplete when
    not, one lifecycle event either way.
    
    Also: agent.ts comment no longer mentions calibration, and the test
    file is renamed context-estimate.test.ts to match what it tests.
    nullcache committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    13fa70d View commit details
    Browse the repository at this point in the history
  18. Merge pull request #12 from nullcache/fix/calibration-usage-followups

    Shrink token accounting: static UTF-8-byte estimate, complete-usage-only bookkeeping, tool exports, stale tests
    nullcache authored Aug 17, 2026
    Configuration menu
    Copy the full SHA
    e60d0a9 View commit details
    Browse the repository at this point in the history
Loading