@panaversity/ksor 0.0.25 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @panaversity/ksor
2
2
 
3
+ ## 0.0.27
4
+
5
+ ### Patch Changes
6
+
7
+ - 6bc9d8f: The emitted `Dockerfile` names the files it copies instead of `COPY . ./`.
8
+
9
+ **A `.dockerignore` is not honoured by every build host.** Vercel's container
10
+ builder ignores it, so `COPY . ./` swept in `node_modules` and the built site —
11
+ about a gigabyte — and the deploy failed with the registry rejecting the push as
12
+ `PAYLOAD_TOO_LARGE`. The error arrives from the host and says nothing about the
13
+ file that caused it.
14
+
15
+ Naming what enters the image is the only form portable across build hosts. The
16
+ `.dockerignore` stays as defence in depth for builders that do respect it, but it
17
+ is no longer what bounds the image.
18
+
19
+ The risk of naming files is forgetting one — which is exactly how the registration
20
+ file came to be missing from the image two releases ago. That is covered: the
21
+ container acceptance job boots the built image and asserts it serves the tools the
22
+ registration names, so a forgotten file fails there rather than at a deploy.
23
+
24
+ ## 0.0.26
25
+
26
+ ### Patch Changes
27
+
28
+ - b90de22: Bound the container image: `.dockerignore` now denies everything and allows only
29
+ what the door needs.
30
+
31
+ The previous shape listed what to exclude, which cannot bound an image — it can
32
+ only exclude what someone thought of. A build output, a cache, a vendored
33
+ dependency or a backup directory in the project root all rode in, and the failure
34
+ arrived as a container registry rejecting the push (`PAYLOAD_TOO_LARGE`) rather
35
+ than as anything about the file that was added.
36
+
37
+ Now: `*`, then `!package.json`, `!instance.md`, and `system/gateways/` — this
38
+ door's own MCP registration. Everything else stays out, including the corpus (the
39
+ door serves from Postgres), the website (a separately hosted surface), and every
40
+ `.env` (a DSN baked into a layer is published to anyone who can pull the image).
41
+
42
+ The container acceptance job now reports the built image's size and fails past a
43
+ ceiling, so an allow-list that stops bounding it goes red here rather than at
44
+ someone's deploy.
45
+
3
46
  ## 0.0.25
4
47
 
5
48
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panaversity/ksor",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Knowledge System of Record — compile governed markdown into a static site for people and an MCP server for AI agents, with citations and measured abstention.",
5
5
  "keywords": [
6
6
  "abstention",
@@ -71,8 +71,8 @@
71
71
  "tsdown": "0.22.14",
72
72
  "typescript": "7.0.2",
73
73
  "vitest": "^4.1.10",
74
- "@panaversity/ksor-content": "0.0.0",
75
- "@panaversity/ksor-content-gateway": "0.0.0"
74
+ "@panaversity/ksor-content-gateway": "0.0.0",
75
+ "@panaversity/ksor-content": "0.0.0"
76
76
  },
77
77
  "engines": {
78
78
  "node": ">=24"
@@ -22,12 +22,16 @@ WORKDIR /app
22
22
  COPY package.json ./
23
23
  RUN npm install --omit=dev --no-audit --no-fund
24
24
 
25
- # The record's identity, configuration, and its MCP registration
26
- # (system/gateways/). What is deliberately ABSENT is decided in .dockerignore —
27
- # the corpus, the website and every secret rather than by listing files here:
28
- # naming them one at a time is how the door came to ship without the very file
29
- # that shapes its tool surface (found live).
30
- COPY . ./
25
+ # The record's identity and configuration, and this door's own MCP registration.
26
+ #
27
+ # NAMED, not `COPY . ./`. A .dockerignore is not honoured by every builder
28
+ # Vercel's is not, and `COPY . ./` there swept in node_modules and the built
29
+ # site, producing a registry push rejected as PAYLOAD_TOO_LARGE (found live).
30
+ # Naming what enters the image is the only form that is portable across build
31
+ # hosts. The risk of naming things is forgetting one; that is covered by a test
32
+ # which boots the built image and asserts it serves the tools this file names.
33
+ COPY instance.md ./
34
+ COPY system/gateways/ ./system/gateways/
31
35
 
32
36
  # Most container hosts inject PORT; 80 is a sane default when nothing does.
33
37
  ENV PORT=80
@@ -1,29 +1,37 @@
1
- # Keep the serving image to what serving needs.
1
+ # DENY EVERYTHING, then allow exactly what the door needs.
2
+ #
3
+ # Defence in depth, NOT the bound. The Dockerfile names the files it copies,
4
+ # because a .dockerignore is not honoured by every build host — Vercel's is
5
+ # not. This file protects local `docker build` and every builder that does
6
+ # respect it; the Dockerfile protects the rest.
7
+ #
8
+ # The inverse — listing what to exclude — cannot bound the image, because it can
9
+ # only exclude what someone thought of. A build output, a cache, a backup
10
+ # directory or a vendored dependency in the project root all end up inside, and
11
+ # the failure arrives as a registry rejecting the push rather than as anything
12
+ # about the file you added (found live: PAYLOAD_TOO_LARGE).
13
+ #
14
+ # So: nothing ships unless it is named here.
15
+ *
2
16
 
3
- # Secrets. The image takes its configuration from the environment at RUN time;
4
- # baking a .env into a layer publishes it to anyone who can pull the image.
5
- .env
6
- .env.*
7
- !.env.example
17
+ # The manifest, which pins @panaversity/ksor and is what `npm install` reads.
18
+ !package.json
8
19
 
9
- # The corpus. The door serves from Postgres knowledge/ was published by
10
- # `ksor ingest` before this container ever started, and copying it in would
11
- # suggest the container reads it. It does not.
12
- knowledge/
20
+ # The record's identity and configuration. Its prose is the MCP server's
21
+ # instructions, so the door genuinely needs the file.
22
+ !instance.md
13
23
 
14
- # The websitethe OTHER surface, built and hosted separately. NOT all of
15
- # system/: system/gateways/ holds this door's own registration, and excluding
16
- # it made the container silently serve the default tool surface while the
17
- # repository said otherwise (found live).
18
- system/site/
24
+ # This door's own MCP registration what its tools are called, what it says it
25
+ # covers, and which of them exist. Excluding it makes the container serve the
26
+ # default surface while your repository says otherwise.
27
+ !system
28
+ system/*
29
+ !system/gateways
19
30
 
20
- # Build and tooling noise.
21
- node_modules/
22
- .git/
23
- .github/
24
- .agents/
25
- .claude/
26
- .gemini/
27
- *.log
28
- .DS_Store
29
- .ksor-denylist.json
31
+ # Deliberately NOT here, and each for a reason:
32
+ # .env configuration arrives from the environment at run time; a DSN
33
+ # baked into a layer is published to anyone who can pull it.
34
+ # knowledge/ the door serves from Postgres. Copying the corpus in would
35
+ # suggest the container reads it, and it never does.
36
+ # system/site/ the other surface, built and hosted separately.
37
+ # node_modules/ installed inside the image, from the manifest above.