Repository navigation
refactor: split the extractor into contracts, ai and quotation workspaces - #1
Merged
Merged
Conversation
…ack .agents/ Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-level circuit breaker, answering-provider in meta - providers take timeouts/base URL as options (no more module-level constants) - createProviderFromSettings + createResilientProvider (stats callback, answeredBy) - one table of default models; meta.provider names the provider that answered - docs: decisions list for Anthony Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…crypted keys, health, audit - admin role (ADMIN_ACCESS_KEY, from the key typed, never a form field); staff cannot open /admin - settings in KV over the environment; 30s cache cleared on write; process-level provider with its breaker - provider/apiKey overrides on /v1/extract and /v1/converse now need a staff session; /test no longer takes a key - shared KV client; per-provider counters; audit of the last 50 changes (no keys) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…aces
The AI package now stops at "guest message in, Trip and reply out". Pricing,
rates, the quotation draft, its validity window and the Odoo handoff moved to
quotation/, and the BFF schema we mirror from upstream moved to contracts/.
One dependency direction: contracts <- ai <- quotation <- bff.
- ai/: converse() no longer builds a quotation draft; quotation's
converseWithQuotation() adds it behind the same ENABLE_HONO_QUOTATION_TOOL
switch, and bff calls that. ConversationTurn moved to domain/conversation.ts
to break the synthesis <-> converse cycle.
- quotation/: draft types split into domain/quotationDraft.ts so
domain/quotationValidity.ts no longer imports application code.
- Cross-package imports go through each package's src/index.ts; they stay
relative because the workspace symlink did not resolve on Vercel.
- tools/ops/check-boundaries.mjs enforces both rules and runs in verify/CI.
- scripts/ moved to tools/{ops,live-eval,site}; their broken imports of
files that no longer existed now point at the ai barrel.
- bff/src/dev.ts read ../../.env.local, a path from the old apps/ depth.
Tests: 939 pass (contracts 3 new, ai 308, quotation 120, bff 508); the 428
ai + quotation tests equal the 428 the old ai/ suite ran. Handoff tests in
questions.test.ts moved to quotation/test/handoffEnvelope.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…egex CodeQL flagged `.replace(/\/+$/, "")` on the DeepSeek base URL, which is now admin-settings input: on a long run of '/' not at the end it backtracks polynomially (measured: 4.5 s for 100k slashes). A loop does the same trim in linear time. The admin page test's <script> regex is now case-insensitive and accepts `</script >`, per CodeQL's bad-HTML-filtering alert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The repo is reorganised into four workspaces with one dependency direction:
contracts/Bff*schemas,GuestType,TransportType, vendored upstream spec (bff-contract/)ai/(waspackages/extractor)quotation/converseWithQuotationbff/(wasapps/casa-bff)tools/scripts/, split intoops/,live-eval/,site/Why
ai/is being moved intotn-casa-quotation-estimator, whose rule forai/is: no Odoo client, no pricing, no submit, types only from contracts. Before this changeai/owned pricing, rates and the Odoo handoff, andconverse()built a priced draft.Design notes
converse()no longer builds the draft.quotation'sconverseWithQuotation()adds it behind the sameENABLE_HONO_QUOTATION_TOOLswitch, andbffcalls that. Behaviour is unchanged.synthesis ↔ converseis broken by movingConversationTurntoai/src/domain/conversation.ts.domain/quotationValidity → application/quotationToolis broken by moving the draft types toquotation/src/domain/quotationDraft.ts.<pkg>/src/index.ts. They stay relative rather than@casa/*, because the workspace symlink did not resolve in the Vercel bundle (see the note at the top ofbff/src/app.ts).npm run check:boundaries(tools/ops/check-boundaries.mjs) runs inverifyand therefore in CI. It rejects a wrong-direction import and a deep import into another package; both were checked by adding a violation on purpose..agents/(36 MB of third-party skills) is no longer tracked and is now git-ignored.Bugs found on the way
scripts/imported files that no longer existed (src/converse.js,src/providerFromEnv.js). They now point at theaibarrel.bff/src/dev.tsread../../.env.local, a path from the oldapps/casa-bffdepth.vitest.config, vitest searched parent directories and loaded a strayE:\vite.config.ts.contracts/now has its own config.Also in this branch
It also contains 4 earlier commits from another session: the Anthropic provider, the settings-driven provider with a circuit breaker, the
/admin/aidashboard, and the/adminroute invercel.json. The restructure commit edits their files, so they cannot be split out cleanly. Review them as their own commits:9d4e9e9,866122b,5e859dd,dada2df.How it was tested
npm run verifypasses: boundaries ok, typecheck ok in all 4 workspaces, 939 tests pass (contracts 3 new, ai 308, quotation 120, bff 508).ai/suite ran atdada2df. The handoff tests fromquestions.test.tsmoved toquotation/test/handoffEnvelope.test.ts./healthz,/and/statusreturn 200, and/v1/extractreturns a real Trip.api/index.tsloads and exports GET/POST/PUT.Not in this PR
public/(31 MB of mp4/png).docs/diagrams/repo-structure.*.tn-casa-quotation-estimator, including reconcilingcontracts/with their officialtrip.zod.ts.🤖 Generated with Claude Code