fix: remove one machine's addresses and paths from the shipped defaults
The plugin was developed against an Ollama on a private LAN address, and that address had reached places that ship: - the `config` parameter description the MODEL reads on every request; - the commented example in `cordis.patch.yml`, the layer every profile applies; - `scripts/smoke.mjs` and `scripts/measure.mjs` endpoint defaults; - both measure scripts' default workspace, which was an absolute local path and named a private repository; - README examples and test fixtures. All of them now use `http://127.0.0.1:11434`, which is Ollama's documented default and belongs to no particular machine — kept rather than emptied because `validateSettings` requires an http(s) URL, so an empty default would turn every call into INVALID_SETTINGS until someone configured it. Test fixtures use 192.0.2.10 instead: TEST-NET-1 is reserved for documentation and cannot point at a host anybody runs. The `focus` and `config` examples are generic, and the workspace defaults are the working directory. Two script bugs surfaced once the defaults stopped pointing at a live box, and are fixed here. `measure.mjs` built its own configuration literal, which was ten fields short of the schema — harmless while nothing validated it, and a refused call the moment `execute` began checking the section it was handed; it now resolves its configuration through the plugin's own `Config`, so it cannot drift again. It also crashed on a failed search (`first.index.scanned` of a result that has no index) instead of reporting the endpoint it could not reach, which is now the ordinary case. `scope-measure.mjs` divided by a scope that does not exist in any workspace without focus markers, and now says so. Also corrects `cordis.patch.yml`'s description of what the row registers: in 0.1.7 the exported `Config` is the settings registration, not a namespace on `ctx.settings`.
This commit is contained in:
1 parent
7261d46ee2
commit
a48e05585e
7 files changed
+93
-48
No files matched your search
@@ -6,10 +6,9 @@
|
||||
* cold-start cost they imply are all arithmetic over the chunker, which is
|
||||
* deterministic and offline.
|
||||
*
|
||||
* The cold-start projection uses the throughput actually measured against the
|
||||
* real endpoint on this repository: 2,257 chunks embedded in 90s, about 25
|
||||
* chunks/s. It is a projection from a real figure, not a guess, and it is
|
||||
* labelled as a projection.
|
||||
* The cold-start projection uses a throughput measured against a live endpoint
|
||||
* during development: 2,257 chunks embedded in 90s, about 25 chunks/s. It is a
|
||||
* projection from a real figure, not a guess, and it is labelled as one.
|
||||
*
|
||||
* node scripts/scope-measure.mjs [workspace]
|
||||
*/
|
||||
@@ -20,9 +19,15 @@ import { join } from 'node:path'
|
||||
import { chunkFile } from '../lib/chunk.js'
|
||||
import { listCodeFiles } from '../lib/walk.js'
|
||||
|
||||
const WORKSPACE = process.argv[2] ?? '/root/workspaces/ha-runtime'
|
||||
// The repository to measure; the working directory by default, so the script
|
||||
// carries no assumption about where anyone keeps their code.
|
||||
const WORKSPACE = process.argv[2] ?? process.cwd()
|
||||
|
||||
/** Chunks per second, measured on this repository against the live endpoint. */
|
||||
/**
|
||||
* Chunks per second, measured against a live endpoint during development
|
||||
* (2,257 chunks in 90s). A measured constant, not a guess — and a projection
|
||||
* input, which is why the cold-start figures below are labelled as projections.
|
||||
*/
|
||||
const MEASURED_CHUNKS_PER_SECOND = 2257 / 90
|
||||
|
||||
/** Count files and chunks for one directory, relative to a base for display. */
|
||||
@@ -98,6 +103,18 @@ async function main() {
|
||||
if (scopes.length > 10) console.log(` … and ${scopes.length - 10} more`)
|
||||
console.log('')
|
||||
|
||||
// A workspace with no marker files has no scopes to compare, and that is a
|
||||
// normal answer rather than a failure — the plugin falls back to the whole
|
||||
// workspace there. Say so and stop, instead of dividing by the scope that
|
||||
// does not exist.
|
||||
if (scopes.length === 0) {
|
||||
console.log('=== WHAT SCOPING BUYS ===')
|
||||
console.log(' nothing here: no directory in this workspace carries a focus marker,')
|
||||
console.log(' so every call indexes the whole workspace. Add a marker file (see')
|
||||
console.log(' focusMarkers in the README) to a module you work on to create one.')
|
||||
return
|
||||
}
|
||||
|
||||
const median = scopes[Math.floor(scopes.length / 2)]
|
||||
const totalScoped = scopes.reduce((sum, scope) => sum + scope.chunks, 0)
|
||||
console.log('=== WHAT SCOPING BUYS ===')
|
||||
|
||||
Reference in new issue
Block a user