Repository navigation
Release: merge Development into main - #267
Conversation
* fix(recommender): correct cached-token double-counting in estimateCost() * fix(recommender): reject negative cachedInputTokens in estimateCost()
* fix(scanner): detect minified and bundled files as generated isGeneratedFile compared path.extname() against compound suffixes like .min.js, but extname only returns the final extension (.js), so the check never matched. Generated assets outside build directories were counted as source, inflating workspace token counts and cost estimates. Match against the basename suffix instead, and correct the test that was asserting the broken behavior. Fixes #7 * test(scanner): add scan-level regression for generated file exclusion Adds a scanWorkspace()-level test covering the outcome from #7: a generated asset outside a build directory (src/vendor.min.js) is flagged as generated, excluded from the workspace, and its tokens are omitted from includedTokens. This fails against the pre-fix classifier and passes against it, so it guards the regression rather than testing classifyFile() in isolation.
* fix(dashboard): require authentication for saved report reads GET /api/reports and GET /api/reports/:id returned data without checking the bearer token that POST already required. Anyone on a non-loopback host could enumerate and read saved reports, workspace paths and file-level metadata included. Reads now need the same bearer token as uploads. The dashboard UI is a static export, so it can't embed the token — instead, browser reads exchange the token once for an opaque session id at POST /api/session, returned as an HttpOnly, SameSite=Strict cookie. That cookie only grants reads. Uploads stay bearer-only, so a cross-site page can't use the cookie to forge a write. Added TCALC_DASHBOARD_PUBLIC_READ for deployments that want reports readable without authentication, opt-in only. Also moved token comparison into one shared helper using crypto.timingSafeEqual, replacing the non-constant-time check the POST path had before. Fixes #8 * fix(dashboard): fail closed when the token is unset, even with public read on denyRead() checked publicRead before checking whether a token was configured, so removing TCALC_DASHBOARD_TOKEN while TCALC_DASHBOARD_PUBLIC_READ was still set left reports readable anyway — the opposite of what the docs promise (unset token means 503 for everything). Reordered so the token check runs first: an unset token now always returns 503 for reads, regardless of publicRead. The flag only ever relaxes access while a token exists. Verified the new test actually guards this: reverting the ordering makes it the only failing test in the suite. * docs(dashboard): require HTTPS on non-loopback deployments HttpOnly and SameSite=Strict protect the session cookie from page scripts and cross-site misuse, but neither protects the token or cookie in transit. Over plain HTTP, both travel in cleartext and are readable by anyone on the network path. Added a note requiring TLS (typically via a reverse proxy) for any deployment where TCALC_DASHBOARD_HOST is not 127.0.0.1, and clarified that the server marks the cookie Secure once it detects HTTPS, directly or via x-forwarded-proto.
…n ties A team policy's preferredModelIds had no effect on recommendations. applyModelProfile() sorted preferred models first, but recommendModels() immediately discarded that order — all three tier rankings end with localeCompare(id), a strict total order that makes input sequence irrelevant. The sort in applyModelProfile was dead code with respect to every tier a user actually sees. recommendModels() also had no parameter to receive the preference, so even fixing the sort alone would not have helped. Insert a preferenceRank tiebreak into each of the three sorts, between the existing secondary scoring key and localeCompare, so it only separates candidates already ranked equally by cost/score/confidence. Scoring, filtering, and privacy handling are unchanged. Thread preferredModelIds through the five call sites that already hold the active profile: apps/cli recommend and report, the MCP recommendModels and generateReport tools, and the VS Code scanWorkspaceCommand. Verified failing without the fix: reverting the three preferenceRank insertions makes exactly the three new tiebreak tests fail, each on the discriminating assertion.
Qodo flagged a missed call site in PR #36: generateAgentRulesTool.ts also calls recommendModels() but never received preferredModelIds, unlike the other five call sites already threaded. This one arguably matters most — the three tier picks flow directly into modelRecommendations and get written into the generated AGENTS.md / .cursorrules file a team's agents actually read. Without this, a team's preferred model was silently absent from their own generated rules, despite docs/p3-capabilities.md promising 'generated rules enforce this policy.' Audited all recommendModels() call sites in the repo (six total, confirmed via grep) to verify no seventh gap exists. Verification: full suite 43 files / 289 tests passed, CLI and VS Code extension typechecks pass.
Validate workspace configuration and surface malformed or invalid values instead of silently falling back to defaults.
Apply ignore and size rules to in-workspace symlinked files before scanner queueing, with regression coverage.
Keep scanner-classified generated files visible in repo-map guidance after exclusion, deduplicate exclusion recommendations, and add end-to-end coverage.
…ors in VSCode command
The maintainer requested executable coverage across the full pipeline, not just unit tests on recommendModels() — unit tests alone missed the generateAgentRulesTool.ts call site (caught only by Qodo's review). Adds two tests that write a real .tcalc/team.json and .tcalc/models.json to a temp workspace and run the actual executeRecommend CLI command against them, exercising every layer: file read (loadTeamPolicy) -> policy parse (parseTeamPolicy) -> profile lookup (getActiveModelProfile) -> catalog filter (applyModelProfile) -> recommendModels -> final output. The two catalog models are identical in every scored dimension, so only the preference tiebreak can separate them. The preferred id sorts after the other alphabetically, so a control run with no team.json proves the tie is genuine (localeCompare picks the untied model), and the second run flips the pick once the policy is written. Verified non-vacuity by breaking five layers independently (recommender comparator, CLI call-site wiring, getActiveModelProfile, team.json parsing, and the file read itself) and confirming each turns the test red. Note this test resolves workspace packages through their built dist/ output, so it requires a rebuild after editing package source -- already covered by the root pnpm build && pnpm test sequence. Full suite: 43 files, 291 tests passed.
* fix(scanner): block path traversal in additionalIgnoreFiles * fix(scanner): resolve ignore-file symlinks and enforce workspace containment
* fix(mcp-server): add timeout to workspace scan tool * fix(mcp-server): advertise timeoutMs in scan_workspace discovery schema
* fix(recommender): require local support in local-first mode * test(recommender): cover hybrid local-first filtering * docs(core): clarify local-first privacy contract * docs: clarify privacy-mode guarantees * test(recommender): keep tier dedup cases privacy-neutral
* fix(repo-map): preserve control-flow blocks during compaction * fix(repo-map): preserve chained control-flow headers during compaction * test: assert control-flow structure is preserved --------- Co-authored-by: TCalc Integration Check <integration-check@localhost> Co-authored-by: Sandesh Prakash Dawkhar <107756643+Sandesh13fr@users.noreply.github.com>
Co-authored-by: Sandesh Prakash Dawkhar <107756643+Sandesh13fr@users.noreply.github.com>
Reconstruct #170 on current Development with multi-root state and fallback save, cancellation, and write failure regression coverage. Co-authored-by: TCalc Integration Check <integration-check@localhost> Co-authored-by: Sandesh Prakash Dawkhar <107756643+Sandesh13fr@users.noreply.github.com>
…143) Co-authored-by: Meghana <m.meghana@cmr.edu.in> Co-authored-by: Sandesh Prakash Dawkhar <107756643+Sandesh13fr@users.noreply.github.com>
docs: make beginner contribution paths welcoming and explicit
Add a prerequisites sentence before the source-build command block in Use the CLI, noting Node.js 22 and pnpm 11.5.2 and linking to CONTRIBUTING.md for the fork/clone and setup walkthrough. The versions match the root packageManager field and the CI Node version. Existing CLI examples are unchanged. Fixes #188
…reqs docs(readme): note Node.js 22 and pnpm 11.5.2 prerequisites
fix(reports): escape token-drift Markdown values (fixes #151)
fix(mcp): preserve overflow warnings in compact recommendations
…ntage fix: standardize language breakdown percentages
recommend_models, generate_report, generate_agent_rules and create_repo_map read policy.defaultGoal before the goal argument, so a team default silently replaced an explicit goal. The CLI already uses --goal ?? defaultGoal; the MCP tools now match it. Fixes #200
Co-authored-by: Sandesh Prakash Dawkhar <107756643+Sandesh13fr@users.noreply.github.com>
Resolves conflicts between the two lines of history: - CONTRIBUTING.md: keep main's guide and policy text, add Development's first-contribution section, fork-based setup and required status checks. - PR template: keep one file (main's PULL_REQUEST_TEMPLATE.md; the two case-variant names collide on Windows/macOS), updated to require an assigned issue and a single open PR. - estimateCost / recommendModels / scanWorkspaceCommand: keep Development (already contains main's preferred-model and validation changes). - scanCache: take main's atomic temp-file write, keep SCAN_CACHE_VERSION. - Drop duplicate preferredModelIds keys introduced by the auto-merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The catalog command tests and CLI smoke validated the bundled catalog against the real clock, so every PR failed once catalogs/models.json passed 90 days. Tests now pin the clock to the catalog's own updatedAt, catalog validate gains --max-age-days (default 90), and smoke checks the command runs without asserting data age. Fixes #218 Co-authored-by: TCalc Integration Check <integration-check@localhost> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Important Review skippedToo many files! This PR contains 123 files, which is 23 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
Brings
mainup to date withDevelopment: 123 commits from 30 authors that were never on the default branch. GitHub's contributor graph only counts the default branch, so none of this work showed up there.Merge with a merge commit, not squash, so each contributor keeps authorship of their commits.
Conflicts resolved in the merge commit (main → Development):
CONTRIBUTING.md: main's guide and policy text, plus Development's first-contribution section, fork-based setup and required status checks.PULL_REQUEST_TEMPLATE.md); the two case-variant names collided on Windows/macOS. It now requires an assigned issue and a single open PR.estimateCost,recommendModels,scanWorkspaceCommand: kept Development, which already contains main's changes.scanCache: main's atomic temp-file write.preferredModelIdskeys left by the auto-merge.Local checks: build, typecheck, lint, and
vitest run(57 files / 553 tests) pass.🤖 Generated with Claude Code