dsh-env-manager-plugin 0.1.0 → 0.1.2

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 (81) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +274 -250
  3. package/client.js +2581 -2581
  4. package/cordis.patch.yml +4 -4
  5. package/docs/00-project/current-state.md +32 -6
  6. package/docs/00-project/glossary.md +215 -215
  7. package/docs/00-project/project-brief.md +114 -114
  8. package/docs/00-project/roadmap.md +89 -89
  9. package/docs/01-architecture/DSH_Environment_Service_Memory_Skill_Brainstorm.md +493 -493
  10. package/docs/01-architecture/api-verification.md +416 -416
  11. package/docs/01-architecture/architecture-overview.md +222 -222
  12. package/docs/01-architecture/data-model.md +930 -930
  13. package/docs/01-architecture/decisions/ADR-0001-plugin-as-bundle.md +29 -29
  14. package/docs/01-architecture/decisions/ADR-0002-file-based-storage.md +25 -25
  15. package/docs/01-architecture/decisions/ADR-0003-skill-router-over-search.md +25 -25
  16. package/docs/01-architecture/decisions/ADR-0004-typescript-host-js-client.md +31 -31
  17. package/docs/01-architecture/decisions/ADR-0005-layered-rule-resolution.md +36 -36
  18. package/docs/01-architecture/decisions/ADR-0006-credentials-as-references.md +30 -30
  19. package/docs/01-architecture/decisions/ADR-0007-session-scoped-default-environment.md +28 -28
  20. package/docs/01-architecture/decisions/ADR-0008-memory-bridge-not-second-store.md +31 -31
  21. package/docs/01-architecture/decisions/ADR-0009-client-host-http-transport.md +87 -87
  22. package/docs/01-architecture/decisions/ADR-0010-environment-plane-model.md +87 -87
  23. package/docs/01-architecture/decisions/ADR-0011-k8s-node-execution-model.md +92 -92
  24. package/docs/01-architecture/design.md +666 -666
  25. package/docs/01-architecture/detailed-design.md +961 -961
  26. package/docs/01-architecture/implementation-plan.md +323 -323
  27. package/docs/01-architecture/module-boundaries.md +306 -306
  28. package/docs/01-architecture/security-model.md +227 -227
  29. package/docs/01-architecture/storage-contract.md +224 -224
  30. package/docs/01-architecture/tool-contract.md +438 -438
  31. package/docs/01-architecture/ui-design.md +587 -587
  32. package/docs/02-harness/agent-behavior.md +36 -36
  33. package/docs/02-harness/change-snapshot-policy.md +29 -29
  34. package/docs/02-harness/client-ui-integration.md +110 -110
  35. package/docs/02-harness/context-policy.md +43 -43
  36. package/docs/02-harness/harness-standard.md +91 -91
  37. package/docs/02-harness/task-execution-policy.md +26 -26
  38. package/docs/02-harness/verification-policy.md +97 -97
  39. package/docs/03-openspec/archive-rule.md +25 -25
  40. package/docs/03-openspec/bugfix-rule.md +30 -30
  41. package/docs/03-openspec/design-rule.md +33 -33
  42. package/docs/03-openspec/openspec-usage-guide.md +31 -31
  43. package/docs/03-openspec/proposal-rule.md +70 -70
  44. package/docs/03-openspec/spec-rule.md +33 -33
  45. package/docs/03-openspec/tasks-rule.md +31 -31
  46. package/docs/04-development/coding-style.md +67 -67
  47. package/docs/04-development/dependency-policy.md +43 -43
  48. package/docs/04-development/development-guide.md +85 -85
  49. package/docs/04-development/directory-convention.md +105 -105
  50. package/docs/04-development/local-run-guide.md +61 -55
  51. package/docs/04-development/testing-guide.md +102 -102
  52. package/docs/05-domain/deployment-template.md +76 -76
  53. package/docs/05-domain/environment-template.md +165 -165
  54. package/docs/05-domain/operation-binding-template.md +55 -55
  55. package/docs/05-domain/operation-record-template.md +55 -55
  56. package/docs/05-domain/prompt-template.md +90 -90
  57. package/docs/05-domain/rule-template.md +73 -73
  58. package/docs/05-domain/service-template.md +39 -39
  59. package/docs/06-operations/deployment-guide.md +54 -54
  60. package/docs/06-operations/release.md +198 -188
  61. package/docs/06-operations/security-policy.md +53 -53
  62. package/docs/06-operations/troubleshooting.md +141 -91
  63. package/docs/07-templates/adr-template.md +21 -21
  64. package/docs/07-templates/bugfix-template.md +11 -11
  65. package/docs/07-templates/case-template.md +15 -15
  66. package/docs/07-templates/design-template.md +29 -29
  67. package/docs/07-templates/proposal-template.md +19 -19
  68. package/docs/07-templates/spec-template.md +15 -15
  69. package/docs/07-templates/tasks-template.md +12 -12
  70. package/docs/99-archive/README.md +13 -13
  71. package/docs/README.md +142 -142
  72. package/icon.svg +4 -4
  73. package/index.js +31 -8
  74. package/lib/app/app.d.ts +1 -1
  75. package/lib/app/app.js +4 -1
  76. package/lib/app/app.js.map +1 -1
  77. package/lib/skill.js +37 -37
  78. package/locale/en.json +6 -6
  79. package/locale/zh.json +6 -6
  80. package/package.json +101 -99
  81. package/scripts/repair-profile.mjs +141 -0
@@ -1,97 +1,97 @@
1
- # Verification Policy
2
-
3
- Every implementation task must include at least one of:
4
-
5
- - unit tests for pure logic
6
- - integration tests for storage / registry / tools
7
- - a manual UI checklist
8
- - a contract check against a fixture
9
-
10
- ## Required by module
11
-
12
- ### `domain`
13
-
14
- - Valid record accepted; unknown field rejected
15
- - Id pattern and `schemaVersion` enforced
16
- - Discriminated union rejects mismatched runtime/location
17
- - `parseRecordInput` accepts omitted timestamps; `finalizeRecord` stamps them
18
-
19
- ### `storage`
20
-
21
- - Atomic write/read round trip
22
- - No temp file left after success or a caught failure
23
- - Missing directory handled
24
- - Invalid YAML skipped with diagnostic, file kept
25
- - Backup pruning (max 5)
26
-
27
- ### `registry`
28
-
29
- - Load and lookup
30
- - Duplicate id detection
31
- - Broken reference detection for every reference kind
32
- - Reload after write reflects the change
33
- - Concurrent loads share one in-flight scan
34
-
35
- ### `resolver`
36
-
37
- - Layer precedence
38
- - Field-level merge
39
- - Provenance for the worked example
40
- - Undefined variable, cycle, path traversal, type mismatch, malformed template
41
- - Only runtime-applicable log source and class location resolved
42
-
43
- ### `router`
44
-
45
- - Every match level
46
- - Highest-level selection
47
- - Same-level conflict
48
- - Skill availability: present, missing, source mismatch, provider mismatch,
49
- registry unavailable or incomplete
50
- - Production policy and approval defaults
51
- - Parameter mapping failures
52
-
53
- ### `session`
54
-
55
- - Set, get, clear
56
- - Cross-session isolation
57
- - Corrupt state treated as "no default", `persisted: false`
58
-
59
- ### `app`
60
-
61
- - Save→get round trip
62
- - Delete refused while referenced
63
- - Dry-run writes nothing
64
- - UI actor production denial
65
-
66
- ### `tools`
67
-
68
- - Returned value matches the declared `output.schema`
69
- - Expected failures throw `EnvManagerError` with the right code
70
- - No credential value in serialized output
71
- - `env_validate` is read-only
72
- - Approval denial changes nothing on disk
73
-
74
- ### `transport`
75
-
76
- - Header, origin, method and size rejection
77
- - Status mapping for each error class
78
- - Production UI write denied by default
79
- - No stack trace or file path in the response body
80
-
81
- ### Client UI (manual)
82
-
83
- - Panels load with empty and populated registries
84
- - Create/edit/delete round trip through the HTTP API
85
- - Rule preview shows provenance
86
- - Conflict warning appears for same-level bindings
87
- - Production actions are visually distinct and confirmed
88
- - Locale switches between `en` and `zh`
89
- - Full checklist: `docs/01-architecture/ui-design.md` §12
90
-
91
- ## Evidence to record
92
-
93
- For each completed task, `current-state.md` should state what was verified and what remains manual.
94
-
95
- ## Regression rule
96
-
97
- A bugfix must add a test that fails before the fix and passes after it, unless the defect is UI-only.
1
+ # Verification Policy
2
+
3
+ Every implementation task must include at least one of:
4
+
5
+ - unit tests for pure logic
6
+ - integration tests for storage / registry / tools
7
+ - a manual UI checklist
8
+ - a contract check against a fixture
9
+
10
+ ## Required by module
11
+
12
+ ### `domain`
13
+
14
+ - Valid record accepted; unknown field rejected
15
+ - Id pattern and `schemaVersion` enforced
16
+ - Discriminated union rejects mismatched runtime/location
17
+ - `parseRecordInput` accepts omitted timestamps; `finalizeRecord` stamps them
18
+
19
+ ### `storage`
20
+
21
+ - Atomic write/read round trip
22
+ - No temp file left after success or a caught failure
23
+ - Missing directory handled
24
+ - Invalid YAML skipped with diagnostic, file kept
25
+ - Backup pruning (max 5)
26
+
27
+ ### `registry`
28
+
29
+ - Load and lookup
30
+ - Duplicate id detection
31
+ - Broken reference detection for every reference kind
32
+ - Reload after write reflects the change
33
+ - Concurrent loads share one in-flight scan
34
+
35
+ ### `resolver`
36
+
37
+ - Layer precedence
38
+ - Field-level merge
39
+ - Provenance for the worked example
40
+ - Undefined variable, cycle, path traversal, type mismatch, malformed template
41
+ - Only runtime-applicable log source and class location resolved
42
+
43
+ ### `router`
44
+
45
+ - Every match level
46
+ - Highest-level selection
47
+ - Same-level conflict
48
+ - Skill availability: present, missing, source mismatch, provider mismatch,
49
+ registry unavailable or incomplete
50
+ - Production policy and approval defaults
51
+ - Parameter mapping failures
52
+
53
+ ### `session`
54
+
55
+ - Set, get, clear
56
+ - Cross-session isolation
57
+ - Corrupt state treated as "no default", `persisted: false`
58
+
59
+ ### `app`
60
+
61
+ - Save→get round trip
62
+ - Delete refused while referenced
63
+ - Dry-run writes nothing
64
+ - UI actor production denial
65
+
66
+ ### `tools`
67
+
68
+ - Returned value matches the declared `output.schema`
69
+ - Expected failures throw `EnvManagerError` with the right code
70
+ - No credential value in serialized output
71
+ - `env_validate` is read-only
72
+ - Approval denial changes nothing on disk
73
+
74
+ ### `transport`
75
+
76
+ - Header, origin, method and size rejection
77
+ - Status mapping for each error class
78
+ - Production UI write denied by default
79
+ - No stack trace or file path in the response body
80
+
81
+ ### Client UI (manual)
82
+
83
+ - Panels load with empty and populated registries
84
+ - Create/edit/delete round trip through the HTTP API
85
+ - Rule preview shows provenance
86
+ - Conflict warning appears for same-level bindings
87
+ - Production actions are visually distinct and confirmed
88
+ - Locale switches between `en` and `zh`
89
+ - Full checklist: `docs/01-architecture/ui-design.md` §12
90
+
91
+ ## Evidence to record
92
+
93
+ For each completed task, `current-state.md` should state what was verified and what remains manual.
94
+
95
+ ## Regression rule
96
+
97
+ A bugfix must add a test that fails before the fix and passes after it, unless the defect is UI-only.
@@ -1,25 +1,25 @@
1
- # Archive Rule
2
-
3
- Completed or superseded proposals and designs must be archived in `docs/99-archive/`.
4
-
5
- ## When to Archive
6
-
7
- - A proposal is implemented and verified.
8
- - A design is superseded by a new one.
9
- - A spike or experiment is abandoned.
10
-
11
- ## Format
12
-
13
- Prefix archived files with date:
14
-
15
- ```text
16
- docs/99-archive/YYYY-MM-DD-proposal-name.md
17
- ```
18
-
19
- ## Content
20
-
21
- Each archived file must include:
22
-
23
- - Original title and date
24
- - Reason for archiving
25
- - Link to the current approach (if superseded)
1
+ # Archive Rule
2
+
3
+ Completed or superseded proposals and designs must be archived in `docs/99-archive/`.
4
+
5
+ ## When to Archive
6
+
7
+ - A proposal is implemented and verified.
8
+ - A design is superseded by a new one.
9
+ - A spike or experiment is abandoned.
10
+
11
+ ## Format
12
+
13
+ Prefix archived files with date:
14
+
15
+ ```text
16
+ docs/99-archive/YYYY-MM-DD-proposal-name.md
17
+ ```
18
+
19
+ ## Content
20
+
21
+ Each archived file must include:
22
+
23
+ - Original title and date
24
+ - Reason for archiving
25
+ - Link to the current approach (if superseded)
@@ -1,30 +1,30 @@
1
- # Bugfix Rule
2
-
3
- A bugfix addresses a specific, reproducible defect.
4
-
5
- ## Required Sections
6
-
7
- ### 1. Symptom
8
-
9
- What went wrong.
10
-
11
- ### 2. Root Cause
12
-
13
- Why it happened.
14
-
15
- ### 3. Fix
16
-
17
- What changed.
18
-
19
- ### 4. Regression Test
20
-
21
- Test that prevents recurrence.
22
-
23
- ### 5. Verification
24
-
25
- How to confirm the fix.
26
-
27
- ## Rules
28
-
29
- - Include a regression test unless the bug is UI-only.
30
- - Update `current-state.md` if the bug affects implemented features.
1
+ # Bugfix Rule
2
+
3
+ A bugfix addresses a specific, reproducible defect.
4
+
5
+ ## Required Sections
6
+
7
+ ### 1. Symptom
8
+
9
+ What went wrong.
10
+
11
+ ### 2. Root Cause
12
+
13
+ Why it happened.
14
+
15
+ ### 3. Fix
16
+
17
+ What changed.
18
+
19
+ ### 4. Regression Test
20
+
21
+ Test that prevents recurrence.
22
+
23
+ ### 5. Verification
24
+
25
+ How to confirm the fix.
26
+
27
+ ## Rules
28
+
29
+ - Include a regression test unless the bug is UI-only.
30
+ - Update `current-state.md` if the bug affects implemented features.
@@ -1,33 +1,33 @@
1
- # Design Rule
2
-
3
- A design document explains how a feature will be built.
4
-
5
- ## Required Sections
6
-
7
- ### 1. Overview
8
-
9
- What is being designed and why.
10
-
11
- ### 2. Data Flow
12
-
13
- Step-by-step flow with input/output boundaries.
14
-
15
- ### 3. Module Allocation
16
-
17
- Which modules are involved and what each owns.
18
-
19
- ### 4. Schema Changes
20
-
21
- New or changed YAML/JSON schemas.
22
-
23
- ### 5. Security Considerations
24
-
25
- Credential handling, approval policies, production access.
26
-
27
- ### 6. Error Handling
28
-
29
- Expected failure modes and responses.
30
-
31
- ### 7. Verification Plan
32
-
33
- Tests and manual checks.
1
+ # Design Rule
2
+
3
+ A design document explains how a feature will be built.
4
+
5
+ ## Required Sections
6
+
7
+ ### 1. Overview
8
+
9
+ What is being designed and why.
10
+
11
+ ### 2. Data Flow
12
+
13
+ Step-by-step flow with input/output boundaries.
14
+
15
+ ### 3. Module Allocation
16
+
17
+ Which modules are involved and what each owns.
18
+
19
+ ### 4. Schema Changes
20
+
21
+ New or changed YAML/JSON schemas.
22
+
23
+ ### 5. Security Considerations
24
+
25
+ Credential handling, approval policies, production access.
26
+
27
+ ### 6. Error Handling
28
+
29
+ Expected failure modes and responses.
30
+
31
+ ### 7. Verification Plan
32
+
33
+ Tests and manual checks.
@@ -1,31 +1,31 @@
1
- # OpenSpec Usage Guide
2
-
3
- Use OpenSpec artifacts to plan and track changes.
4
-
5
- ## Artifact Types
6
-
7
- - **Proposal**: Why and what we will change.
8
- - **Design**: How we will build it.
9
- - **Spec**: Detailed implementation contract.
10
- - **Tasks**: Small, verifiable work items.
11
- - **Bugfix**: Specific defect resolution.
12
-
13
- ## Workflow
14
-
15
- 1. Create a proposal in `docs/03-openspec/proposals/` (or similar).
16
- 2. Once accepted, write a design in `docs/01-architecture/designs/` (or update `design.md`).
17
- 3. Turn the design into a spec.
18
- 4. Break into tasks.
19
- 5. Implement, verify, archive.
20
-
21
- ## Naming
22
-
23
- - Proposals: `proposal-{short-name}.md`
24
- - Designs: `design-{short-name}.md`
25
- - Specs: `spec-{short-name}.md`
26
- - Tasks: embedded in implementation issue or PR description
27
- - Bugfixes: `bugfix-{short-name}.md`
28
-
29
- ## Review
30
-
31
- Every OpenSpec artifact should be reviewed before implementation.
1
+ # OpenSpec Usage Guide
2
+
3
+ Use OpenSpec artifacts to plan and track changes.
4
+
5
+ ## Artifact Types
6
+
7
+ - **Proposal**: Why and what we will change.
8
+ - **Design**: How we will build it.
9
+ - **Spec**: Detailed implementation contract.
10
+ - **Tasks**: Small, verifiable work items.
11
+ - **Bugfix**: Specific defect resolution.
12
+
13
+ ## Workflow
14
+
15
+ 1. Create a proposal in `docs/03-openspec/proposals/` (or similar).
16
+ 2. Once accepted, write a design in `docs/01-architecture/designs/` (or update `design.md`).
17
+ 3. Turn the design into a spec.
18
+ 4. Break into tasks.
19
+ 5. Implement, verify, archive.
20
+
21
+ ## Naming
22
+
23
+ - Proposals: `proposal-{short-name}.md`
24
+ - Designs: `design-{short-name}.md`
25
+ - Specs: `spec-{short-name}.md`
26
+ - Tasks: embedded in implementation issue or PR description
27
+ - Bugfixes: `bugfix-{short-name}.md`
28
+
29
+ ## Review
30
+
31
+ Every OpenSpec artifact should be reviewed before implementation.
@@ -1,70 +1,70 @@
1
- # Proposal Rule
2
-
3
- A proposal must explain why the change is needed and what it changes.
4
-
5
- ## Required Sections
6
-
7
- ### 1. Problem
8
-
9
- Describe the user-visible or engineering problem.
10
-
11
- ### 2. Goal
12
-
13
- Describe the intended outcome.
14
-
15
- ### 3. Scope
16
-
17
- List what is included.
18
-
19
- ### 4. Out of Scope
20
-
21
- List what is explicitly excluded.
22
-
23
- ### 5. Affected Modules
24
-
25
- Choose from:
26
-
27
- - tools
28
- - domain
29
- - config
30
- - storage
31
- - registry
32
- - resolver
33
- - router
34
- - session
35
- - memory-bridge
36
- - client
37
- - docs
38
-
39
- ### 6. Storage Impact
40
-
41
- State whether the change affects:
42
-
43
- - `data/environments/*.yaml`
44
- - `data/services/*.yaml`
45
- - `data/deployments/*.yaml`
46
- - `data/rules/*.yaml`
47
- - `data/operations/*.yaml`
48
- - `data/sessions/*.json`
49
- - `schemaVersion` (record compatibility)
50
-
51
- ### 7. Constraints
52
-
53
- Must confirm:
54
-
55
- - No plain-text credentials introduced.
56
- - No arbitrary code execution in rule templates.
57
- - No auto-apply of production changes.
58
- - File-based source of truth remains unchanged.
59
-
60
- ### 8. Risks
61
-
62
- List implementation risks.
63
-
64
- ### 9. Verification
65
-
66
- Describe how to verify.
67
-
68
- ## Proposal Quality Bar
69
-
70
- A good proposal is small enough to implement and test in one focused change.
1
+ # Proposal Rule
2
+
3
+ A proposal must explain why the change is needed and what it changes.
4
+
5
+ ## Required Sections
6
+
7
+ ### 1. Problem
8
+
9
+ Describe the user-visible or engineering problem.
10
+
11
+ ### 2. Goal
12
+
13
+ Describe the intended outcome.
14
+
15
+ ### 3. Scope
16
+
17
+ List what is included.
18
+
19
+ ### 4. Out of Scope
20
+
21
+ List what is explicitly excluded.
22
+
23
+ ### 5. Affected Modules
24
+
25
+ Choose from:
26
+
27
+ - tools
28
+ - domain
29
+ - config
30
+ - storage
31
+ - registry
32
+ - resolver
33
+ - router
34
+ - session
35
+ - memory-bridge
36
+ - client
37
+ - docs
38
+
39
+ ### 6. Storage Impact
40
+
41
+ State whether the change affects:
42
+
43
+ - `data/environments/*.yaml`
44
+ - `data/services/*.yaml`
45
+ - `data/deployments/*.yaml`
46
+ - `data/rules/*.yaml`
47
+ - `data/operations/*.yaml`
48
+ - `data/sessions/*.json`
49
+ - `schemaVersion` (record compatibility)
50
+
51
+ ### 7. Constraints
52
+
53
+ Must confirm:
54
+
55
+ - No plain-text credentials introduced.
56
+ - No arbitrary code execution in rule templates.
57
+ - No auto-apply of production changes.
58
+ - File-based source of truth remains unchanged.
59
+
60
+ ### 8. Risks
61
+
62
+ List implementation risks.
63
+
64
+ ### 9. Verification
65
+
66
+ Describe how to verify.
67
+
68
+ ## Proposal Quality Bar
69
+
70
+ A good proposal is small enough to implement and test in one focused change.
@@ -1,33 +1,33 @@
1
- # Spec Rule
2
-
3
- A spec document turns a proposal into actionable implementation details.
4
-
5
- ## Required Sections
6
-
7
- ### 1. Objectives
8
-
9
- Clear, measurable outcomes.
10
-
11
- ### 2. Functional Requirements
12
-
13
- What the system must do.
14
-
15
- ### 3. Non-functional Requirements
16
-
17
- Performance, security, compatibility constraints.
18
-
19
- ### 4. Interface Definitions
20
-
21
- Tool names, parameters, return values, events.
22
-
23
- ### 5. Data Definitions
24
-
25
- Schemas for inputs, outputs and storage records.
26
-
27
- ### 6. Acceptance Criteria
28
-
29
- Specific conditions that must be met.
30
-
31
- ### 7. Open Questions
32
-
33
- Unresolved items to confirm before implementation.
1
+ # Spec Rule
2
+
3
+ A spec document turns a proposal into actionable implementation details.
4
+
5
+ ## Required Sections
6
+
7
+ ### 1. Objectives
8
+
9
+ Clear, measurable outcomes.
10
+
11
+ ### 2. Functional Requirements
12
+
13
+ What the system must do.
14
+
15
+ ### 3. Non-functional Requirements
16
+
17
+ Performance, security, compatibility constraints.
18
+
19
+ ### 4. Interface Definitions
20
+
21
+ Tool names, parameters, return values, events.
22
+
23
+ ### 5. Data Definitions
24
+
25
+ Schemas for inputs, outputs and storage records.
26
+
27
+ ### 6. Acceptance Criteria
28
+
29
+ Specific conditions that must be met.
30
+
31
+ ### 7. Open Questions
32
+
33
+ Unresolved items to confirm before implementation.