katalyst-plugin-context 0.2.1a17__tar.gz → 0.2.1a19__tar.gz

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.
Files changed (54) hide show
  1. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/.gitignore +3 -0
  2. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/PKG-INFO +1 -1
  3. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/pyproject.toml +1 -1
  4. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/features/cli/52_kata_context.feature +12 -12
  5. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/features/cli/53_kata_context_budget_policy.feature +4 -4
  6. katalyst_plugin_context-0.2.1a19/xspec/features/cli/54_kata_context_plugin_turned_off.feature +52 -0
  7. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/features/mcp/09_mcp_context.feature +2 -2
  8. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/steps/context.ts +13 -4
  9. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/Justfile +0 -0
  10. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/__init__.py +0 -0
  11. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/adapters/__init__.py +0 -0
  12. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/adapters/runtime_graph.py +0 -0
  13. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/cli.py +0 -0
  14. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/composition.py +0 -0
  15. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/domain/__init__.py +0 -0
  16. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/domain/context.py +0 -0
  17. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/domain/graph.py +0 -0
  18. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/domain/markdown.py +0 -0
  19. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/domain/paths.py +0 -0
  20. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/domain/policy.py +0 -0
  21. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/domain/settings.py +0 -0
  22. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/lint.py +0 -0
  23. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/mcp_tools.py +0 -0
  24. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/plugin.py +0 -0
  25. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/py.typed +0 -0
  26. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/rest.py +0 -0
  27. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/schema.py +0 -0
  28. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/katalyst_plugin_context/service.py +0 -0
  29. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/src/layer.yaml +0 -0
  30. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/conftest.py +0 -0
  31. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/context_support.py +0 -0
  32. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/test_context.py +0 -0
  33. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/test_cross_backend_edges.py +0 -0
  34. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/test_lint.py +0 -0
  35. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/test_shared_names.py +0 -0
  36. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/test_source_install.py +0 -0
  37. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/tests/test_surfaces.py +0 -0
  38. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/.gitignore +0 -0
  39. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/Justfile +0 -0
  40. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/areas/payments.yaml +0 -0
  41. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/checks/encrypt-card-data.scan-for-card-numbers.yaml +0 -0
  42. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/components/payments.checkout.web-api.yaml +0 -0
  43. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/decisions/async-events.yaml +0 -0
  44. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/decisions/pin-httpx.yaml +0 -0
  45. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/decisions/use-postgres.yaml +0 -0
  46. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/packages/httpx.yaml +0 -0
  47. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/rules/encrypt-card-data.yaml +0 -0
  48. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/rules/log-correlation-id.yaml +0 -0
  49. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/fixtures/context-catalogue/catalogue/services/payments.checkout.yaml +0 -0
  50. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/layer.yaml +0 -0
  51. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/package.json +0 -0
  52. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/playwright.config.ts +0 -0
  53. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/steps/steps.ts +0 -0
  54. {katalyst_plugin_context-0.2.1a17 → katalyst_plugin_context-0.2.1a19}/xspec/tsconfig.json +0 -0
@@ -125,3 +125,6 @@ node_modules/
125
125
  # Bard's built web assets (SPA, server bundle, desktop shell): build output, made by
126
126
  # scripts/build_bard_web.sh where Bard is tested, packaged or served. The wheel includes them.
127
127
  plugins/bard/src/katalyst_plugin_bard/web_dist/
128
+
129
+ # `just dev-bundle`: kata without the test bundle
130
+ .venv-bundle/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: katalyst-plugin-context
3
- Version: 0.2.1a17
3
+ Version: 0.2.1a19
4
4
  Summary: Katalyst context plugin — the right context from the taxonomy for an agent working on a node
5
5
  Author: eSimplicity
6
6
  License: Proprietary
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "katalyst-plugin-context"
3
- version = "0.2.1a17"
3
+ version = "0.2.1a19"
4
4
  description = "Katalyst context plugin — the right context from the taxonomy for an agent working on a node"
5
5
  license = { text = "Proprietary" }
6
6
  requires-python = ">=3.13,<3.14"
@@ -30,7 +30,7 @@ Feature: Kata CLI - Context: what an agent working on a node gets
30
30
  And the output should contain "# Context: component `filesystem:payments.checkout.web-api`"
31
31
  And the output should contain "Ancestors: service `filesystem:payments.checkout` ← area `filesystem:payments`"
32
32
  And the output should contain "- `USES_PACKAGE:out` → package ×1"
33
- And the output should contain "- `GOVERNED_BY:out` → decision ×1 — inherited from `filesystem:payments.checkout`"
33
+ And the output should contain "- `FOLLOWS_DECISION:out` → decision ×1 — inherited from `filesystem:payments.checkout`"
34
34
  And the output should contain "- `FOLLOWS_RULE:out` → rule ×1 — inherited from `filesystem:payments`"
35
35
  And the output should contain "- **governance** (always included): Governing decisions and rules — 5 item(s)"
36
36
  And the output should contain "- **package-decisions**: Decisions on the packages it uses — 1 item(s)"
@@ -248,27 +248,27 @@ Feature: Kata CLI - Context: what an agent working on a node gets
248
248
  # ─────────────────────────────────────────────────────────────
249
249
 
250
250
  Scenario: An item reached by two routes prints its shortest route and counts the other
251
- When I run "kata tax relate filesystem:payments.checkout.web-api GOVERNED_BY filesystem:pin-httpx"
251
+ When I run "kata tax relate filesystem:payments.checkout.web-api FOLLOWS_DECISION filesystem:pin-httpx"
252
252
  Then the command should succeed
253
- When I run "kata tax context filesystem:payments.checkout.web-api --path USES_PACKAGE:out/GOVERNED_BY:out --detail summary"
253
+ When I run "kata tax context filesystem:payments.checkout.web-api --path USES_PACKAGE:out/FOLLOWS_DECISION:out --detail summary"
254
254
  Then the command should succeed
255
- And the output should contain "why: ─GOVERNED_BY→ (+1 more route)"
256
- And the output should not contain "package filesystem:httpx ─GOVERNED_BY→"
255
+ And the output should contain "why: ─FOLLOWS_DECISION→ (+1 more route)"
256
+ And the output should not contain "package filesystem:httpx ─FOLLOWS_DECISION→"
257
257
 
258
258
  Scenario: At full detail the markdown lists every route
259
- When I run "kata tax relate filesystem:payments.checkout.web-api GOVERNED_BY filesystem:pin-httpx"
259
+ When I run "kata tax relate filesystem:payments.checkout.web-api FOLLOWS_DECISION filesystem:pin-httpx"
260
260
  Then the command should succeed
261
- When I run "kata tax context filesystem:payments.checkout.web-api --path USES_PACKAGE:out/GOVERNED_BY:out --detail full"
261
+ When I run "kata tax context filesystem:payments.checkout.web-api --path USES_PACKAGE:out/FOLLOWS_DECISION:out --detail full"
262
262
  Then the command should succeed
263
- And the output should contain "why: ─GOVERNED_BY→"
264
- And the output should contain "why: ─USES_PACKAGE→ package filesystem:httpx ─GOVERNED_BY→"
263
+ And the output should contain "why: ─FOLLOWS_DECISION→"
264
+ And the output should contain "why: ─USES_PACKAGE→ package filesystem:httpx ─FOLLOWS_DECISION→"
265
265
  And the output should not contain "more route"
266
266
 
267
267
  Scenario: The JSON keeps every route, the shortest first
268
- When I run "kata tax relate filesystem:payments.checkout.web-api GOVERNED_BY filesystem:pin-httpx"
268
+ When I run "kata tax relate filesystem:payments.checkout.web-api FOLLOWS_DECISION filesystem:pin-httpx"
269
269
  Then the command should succeed
270
- When I run "kata tax context filesystem:payments.checkout.web-api --path USES_PACKAGE:out/GOVERNED_BY:out --detail summary --format json"
270
+ When I run "kata tax context filesystem:payments.checkout.web-api --path USES_PACKAGE:out/FOLLOWS_DECISION:out --detail summary --format json"
271
271
  Then the command should succeed
272
272
  And the JSON output at "$.items[?(@.qualifiedName=='filesystem:pin-httpx')].why[*]" should have 2 items
273
- And the JSON output at "$.items[?(@.qualifiedName=='filesystem:pin-httpx')].why[0].path" should equal "GOVERNED_BY:out"
273
+ And the JSON output at "$.items[?(@.qualifiedName=='filesystem:pin-httpx')].why[0].path" should equal "FOLLOWS_DECISION:out"
274
274
 
@@ -33,7 +33,7 @@ Feature: Kata CLI - Context: the budget, profile policy, and lint of the policy
33
33
  And the JSON output at "$.truncated.cut[*].qualifiedNames[*]" should contain "filesystem:log-correlation-id"
34
34
  And the JSON output at "$.truncated.cut[*].qualifiedNames[*]" should contain "filesystem:encrypt-card-data.scan-for-card-numbers"
35
35
  And the JSON output at "$.truncated.cut[*].qualifiedNames[*]" should not contain "filesystem:encrypt-card-data"
36
- And the JSON output at "$.truncated.hint.budget" should equal "270"
36
+ And the JSON output at "$.truncated.hint.budget" should equal "272"
37
37
 
38
38
  Scenario: The markdown names what the budget cut, and how to get it
39
39
  When I run "kata tax context filesystem:payments.checkout.web-api --budget 100"
@@ -41,7 +41,7 @@ Feature: Kata CLI - Context: the budget, profile policy, and lint of the policy
41
41
  And the output should contain "⛔ blocking · **Encrypt card data** `filesystem:encrypt-card-data`"
42
42
  And the output should contain "## Cut by the budget (100 tokens;"
43
43
  And the output should contain "view governance, `FOLLOWS_RULE:out`: 1 cut — `filesystem:log-correlation-id`"
44
- And the output should contain "More: ask again with budget 270."
44
+ And the output should contain "More: ask again with budget 272."
45
45
 
46
46
  Scenario: The budget returns the same items over JSON and over markdown
47
47
  When I run "kata tax context filesystem:payments.checkout.web-api --budget 100 --format json"
@@ -51,7 +51,7 @@ Feature: Kata CLI - Context: the budget, profile policy, and lint of the policy
51
51
  And the context output should show the recorded item names
52
52
 
53
53
  Scenario: Asking again with the hinted budget returns everything
54
- When I run "kata tax context filesystem:payments.checkout.web-api --budget 270 --format json"
54
+ When I run "kata tax context filesystem:payments.checkout.web-api --budget 272 --format json"
55
55
  Then the command should succeed
56
56
  And the JSON output at "$.items[*]" should have 5 items
57
57
  And the JSON output at "$.truncated" should be null
@@ -80,7 +80,7 @@ Feature: Kata CLI - Context: the budget, profile policy, and lint of the policy
80
80
  And the JSON output at "$.items[*].qualifiedName" should not contain "filesystem:pin-httpx"
81
81
  And the JSON output at "$.policy.layers" should contain "profile:reviewer"
82
82
  And the JSON output at "$.policy.notes[*].text" should contain "view 'governance' path 'FOLLOWS_RULE:out/CHILD_OF:in:check' is hidden by profile:reviewer"
83
- And the JSON output at "$.policy.notes[*].text" should contain "view 'package-decisions' path 'USES_PACKAGE:out/GOVERNED_BY:out' is hidden by profile:reviewer"
83
+ And the JSON output at "$.policy.notes[*].text" should contain "view 'package-decisions' path 'USES_PACKAGE:out/FOLLOWS_DECISION:out' is hidden by profile:reviewer"
84
84
  And the JSON output at "$.policy.clamped[?(@.control=='detail')].requested" should equal "full"
85
85
  And the JSON output at "$.policy.clamped[?(@.control=='detail')].effective" should equal "summary"
86
86
  And the JSON output at "$.policy.clamped[?(@.control=='detail')].limitedBy" should equal "profile:reviewer"
@@ -0,0 +1,52 @@
1
+ @cli @area-context
2
+ Feature: Kata CLI - Context: a plugin turned off in the configuration contributes nothing
3
+ As an operator who has turned the context plugin off
4
+ I want it to add no lint rule and no command, whatever else its section of the configuration says
5
+ So that off means off, in every command
6
+
7
+ # `enabled: false` on a plugin of `spec.plugins` stops it everywhere: the lint rules it
8
+ # adds, the `kata tax context` command, the REST routes and MCP tools. The same configuration with the
9
+ # plugin on warns in 53_kata_context_budget_policy.feature. See also
10
+ # mcp/xspec/features/api/19_api_plugin_turned_off.feature (the REST routes).
11
+ # (github.com/esimplicityinc/katalyst-taxonomy/issues/347)
12
+
13
+ Background:
14
+ Given the payments catalogue is installed
15
+
16
+ @smoke
17
+ Scenario: A plugin turned off adds no lint rule
18
+ Given I run "kata config profile create reviewer --copy-from local"
19
+ And the context plugin is turned off and configured with:
20
+ """
21
+ profiles:
22
+ reviewer:
23
+ policy:
24
+ paths: { deny: ["*:in", "USES_PACKAGE"] }
25
+ """
26
+ When I run "kata tax lint"
27
+ Then the command should succeed
28
+ And the output should not contain "context-policy"
29
+ And the output should not contain "Rule warnings"
30
+
31
+ Scenario: A plugin turned off adds no command
32
+ Given the context plugin is turned off and configured with:
33
+ """
34
+ policy:
35
+ max_depth: 3
36
+ """
37
+ When I run "kata tax context filesystem:payments.checkout.web-api"
38
+ Then the command should fail
39
+ And the output should contain "No such command 'context'"
40
+
41
+ Scenario: The same section with the plugin on is linted
42
+ Given I run "kata config profile create reviewer --copy-from local"
43
+ And the context plugin is configured with:
44
+ """
45
+ profiles:
46
+ reviewer:
47
+ policy:
48
+ paths: { deny: ["*:in", "USES_PACKAGE"] }
49
+ """
50
+ When I run "kata tax lint"
51
+ Then the command should succeed
52
+ And the output should contain "[context-policy]"
@@ -32,7 +32,7 @@ Feature: MCP Server - Context: taxonomy_context_map and taxonomy_context
32
32
  And the JSON result at "$.data.views[?(@.name=='governance')].always" should equal "true"
33
33
  And the JSON result at "$.data.views[?(@.name=='package-decisions')].always" should equal "false"
34
34
  And the JSON result at "$.data.relationships[*].path" should contain "USES_PACKAGE:out"
35
- And the JSON result at "$.data.options.steps" should contain "GOVERNED_BY:out"
35
+ And the JSON result at "$.data.options.steps" should contain "FOLLOWS_DECISION:out"
36
36
  And the JSON result at "$.data.always.items[*].qualifiedName" should contain "filesystem:encrypt-card-data"
37
37
 
38
38
  @smoke
@@ -132,7 +132,7 @@ Feature: MCP Server - Context: taxonomy_context_map and taxonomy_context
132
132
  And the JSON result at "$.data.items[*].qualifiedName" should not include the value "filesystem:pin-httpx"
133
133
  And the JSON result at "$.data.items[*].qualifiedName" should not include the value "filesystem:encrypt-card-data.scan-for-card-numbers"
134
134
  And the JSON result at "$.data.policy.layers" should contain "profile:reviewer"
135
- And the JSON result at "$.data.policy.notes[*].text" should contain "view 'package-decisions' path 'USES_PACKAGE:out/GOVERNED_BY:out' is hidden by profile:reviewer"
135
+ And the JSON result at "$.data.policy.notes[*].text" should contain "view 'package-decisions' path 'USES_PACKAGE:out/FOLLOWS_DECISION:out' is hidden by profile:reviewer"
136
136
  And the JSON result at "$.data.policy.clamped[?(@.control=='detail')].effective" should equal "summary"
137
137
 
138
138
  Scenario: An FQTN that two kinds share is refused, with the names that disambiguate it
@@ -35,19 +35,19 @@ function copyPayments(repoDir: string): void {
35
35
  * The text that goes under `spec:` of config.yaml to configure the context plugin: the
36
36
  * docstring is the plugin's `config` mapping.
37
37
  */
38
- function pluginsBlock(configYaml: string): string {
38
+ function pluginsBlock(configYaml: string, enabled = true): string {
39
39
  const body = dedent(configYaml)
40
40
  .split('\n')
41
41
  .map((line) => (line.length > 0 ? ` ${line}` : line))
42
42
  .join('\n');
43
- return [' plugins:', ' - name: context', ' config:', body, ''].join('\n');
43
+ return [' plugins:', ' - name: context', ...(enabled ? [] : [' enabled: false']), ' config:', body, ''].join('\n');
44
44
  }
45
45
 
46
46
  /** Append the plugin block to a config file whose `spec:` is its last mapping. */
47
- function appendPluginConfig(configFile: string, configYaml: string): void {
47
+ function appendPluginConfig(configFile: string, configYaml: string, enabled = true): void {
48
48
  const current = fs.readFileSync(configFile, 'utf-8');
49
49
  expect(current, `${configFile} already configures plugins`).not.toContain('\n plugins:');
50
- fs.writeFileSync(configFile, `${current.replace(/\n*$/, '\n')}${pluginsBlock(configYaml)}`, 'utf-8');
50
+ fs.writeFileSync(configFile, `${current.replace(/\n*$/, '\n')}${pluginsBlock(configYaml, enabled)}`, 'utf-8');
51
51
  }
52
52
 
53
53
  /**
@@ -107,6 +107,15 @@ export function registerContextSteps(test: typeof sharedTest): void {
107
107
  },
108
108
  );
109
109
 
110
+ Given(
111
+ 'the context plugin is turned off and configured with:',
112
+ { tags: '@cli' },
113
+ async ({ cliWorld }: { cliWorld: CliWorld }, docString: string) => {
114
+ const home = buildEnv(cliWorld).KATALYST_HOME as string;
115
+ appendPluginConfig(path.join(home, 'config', 'config.yaml'), docString, false);
116
+ },
117
+ );
118
+
110
119
  When(
111
120
  'I record the item names of the context output',
112
121
  { tags: '@cli' },