Skip to content

Commit bc2670c

Browse files
author
Mateusz
committed
Add Postgres/Bun persistence for continuity and secure sessions
- Add internal/infra/db (pool, open, timeouts) and bun-backed continuity + securesession stores with baselines and contract tests. - Extend config/runtime wiring, stdhttp server, testkit postgres helpers, CI qa workflow, and arch import guards. - Document operator persistence; refresh steering, AGENTS, README, sample config; archive bun-database-abstraction Kiro spec. Made-with: Cursor
1 parent f1c9b23 commit bc2670c

83 files changed

Lines changed: 5558 additions & 260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/qa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
# Conformance/parity suites live under ./internal/testkit/conformance/... and run here (no duplicate step).
2727
- name: Unit tests
28-
run: go test -parallel=8 -tags=precommit ./...
28+
run: go test -parallel=8 -tags=precommit,integration ./...
2929

3030
- name: Release gates (fuzz smoke)
3131
env:

.kiro/settings/templates/specs/design.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,23 @@ When modifying existing systems:
8181
- New components rationale: [why each is needed]
8282
- Steering compliance: [principles maintained]
8383

84+
**Optional Hexagonal Lens** *(use when it clarifies ownership; delete for trivial changes)*:
85+
- Domain policy: [pure invariants or business rules, if any]
86+
- App/use-case orchestration: [workflow order, transaction intent, idempotency, side-effect sequencing]
87+
- Driving adapters: [HTTP/CLI/test harness decode and error mapping]
88+
- Driven adapters: [provider, storage, diagnostics, queue, or file-system translation]
89+
- Composition root: [where concrete dependencies are constructed and wired]
90+
- Ports/query seams: [consumer-owned interfaces or read DTOs, only where there is real substitution/read-model value]
91+
92+
**Project Boundary Questions (Go LIP)**:
93+
- Core-owned or plugin-owned? [answer and rationale]
94+
- New canonical concept, or provider/adapter-specific behavior? [answer and rationale]
95+
- Streaming-first path preserved? [how non-streaming collects from stream, if applicable]
96+
- Provider SDK leakage avoided? [which package owns SDK/wire types]
97+
- No retry/failover after first client-visible output preserved? [yes/no and proof point]
98+
- Secure-session, diagnostics, or startup-security posture affected? [yes/no and required revalidation]
99+
- Extension platform seam used or extended? [stage/facade, or why no seam applies]
100+
84101
### Technology Stack
85102

86103
| Layer | Choice / Version | Role in Feature | Notes |

.kiro/settings/templates/specs/requirements.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- **In scope**: {{IN_SCOPE_BEHAVIORS}}
99
- **Out of scope**: {{OUT_OF_SCOPE_BEHAVIORS}}
1010
- **Adjacent expectations**: {{ADJACENT_SYSTEM_OR_SPEC_EXPECTATIONS}}
11+
- **Boundary ownership**: Core / frontend plugin / backend plugin / feature plugin / SDK / docs-only: {{BOUNDARY_OWNER}}
12+
- **Optional hexagonal lens**: Domain policy / app orchestration / driving adapter / driven adapter / composition root: {{OPTIONAL_HEXAGONAL_OWNERSHIP}}
13+
- **Revalidation triggers**: Routing / streaming / capability negotiation / secure session / diagnostics / startup security: {{REVALIDATION_TRIGGERS}}
1114

1215
## Requirements
1316

.kiro/settings/templates/specs/tasks.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ Use whichever pattern fits the work breakdown:
1616
- {{DETAIL_ITEM_2}}
1717
- {{OBSERVABLE_COMPLETION_ITEM}} *(At least one detail item should state the observable completion condition for this task.)*
1818
- _Requirements: {{REQUIREMENT_IDS}}_ *(IDs only; do not add descriptions or parentheses.)*
19-
- _Boundary: {{COMPONENT_NAMES}}_ *(Only for (P) tasks. Omit when scope is obvious.)*
20-
- _Depends: {{TASK_IDS}}_ *(Only for non-obvious cross-boundary dependencies. Most tasks omit this.)*
19+
- _Boundary: {{CORE_OR_PLUGIN_OR_SDK_OR_DOCS}}_
20+
- _Depends: {{TASK_OR_SPEC_DEPENDENCIES}}_
21+
- _Validation: {{TEST_OR_CHECK_COMMANDS}}_
2122

2223
> **Parallel marker**: Append ` (P)` only to tasks that can be executed in parallel. Omit the marker when running in `--sequential` mode.
2324
>
2425
> **Optional test coverage**: When a sub-task is deferrable test work tied to acceptance criteria, mark the checkbox as `- [ ]*` and explain the referenced requirements in the detail bullets.
26+
>
27+
> **Boundary annotations**: For this Go LIP repo, use `_Boundary:_` for core/runtime, frontend plugin, backend plugin, feature plugin, SDK/public contract, config/wiring, docs, or tests. Use `_Validation:_` to name the focused command that proves the task.
28+
> If the task uses a hexagonal split, name the owner precisely (`domain policy`, `app orchestration`, `driving adapter`, `driven adapter`, `composition root`, `query seam`) instead of adding generic layer work.

.kiro/settings/templates/steering-custom/testing.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ Naming:
2323
- E2E: full flows, minimal mocks, only for critical journeys
2424

2525
## Structure (AAA)
26-
```typescript
27-
it('does X when Y', () => {
28-
// Arrange
29-
const input = setup();
30-
// Act
31-
const result = act(input);
32-
// Assert
33-
expect(result).toEqual(expected);
34-
});
26+
```go
27+
func TestFeature_Behavior(t *testing.T) {
28+
// Arrange
29+
input := setup(t)
30+
// Act
31+
got := run(input)
32+
// Assert
33+
if got != want {
34+
t.Fatalf("got %v, want %v", got, want)
35+
}
36+
}
3537
```
3638

3739
## Mocking & Data
@@ -43,5 +45,9 @@ it('does X when Y', () => {
4345
- Target: [% overall]; higher for critical domains
4446
- Enforce thresholds in CI; exceptions require review rationale
4547

48+
## Critical Behavior Contracts
49+
- [List behavior that must always have regression coverage: streaming order, security denial, routing/failover, persistence, etc.]
50+
- [List validation commands or CI gates that prove the contract.]
51+
4652
---
4753
_Focus on patterns and decisions. Tool-specific config lives elsewhere._

.kiro/settings/templates/steering/structure.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,13 @@ import { Local } from './local' // Relative
3737
3838
[Key architectural patterns and dependency rules]
3939
40+
## Boundary Ownership
41+
42+
[Record which packages own core policy, protocol adapters, plugin SDK contracts, feature extension seams, composition roots, test harnesses, and operational/security guardrails. Do not list every file.]
43+
44+
## Optional Hexagonal Guidance
45+
46+
[If useful for the project, record how domain policy, app/use-case orchestration, driving adapters, driven adapters, query seams, and composition roots map onto the existing package layout. Do not imply a repo-wide rename is required.]
47+
4048
---
4149
_Document patterns, not file trees. New files following patterns shouldn't require updates_

.kiro/settings/templates/steering/tech.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,13 @@
4141

4242
[Important architectural choices and rationale]
4343

44+
## Boundary and Security Posture
45+
46+
[For Go LIP-style proxy projects: capture where protocol adapters, provider SDKs, runtime security checks, diagnostics, and extension seams belong. Keep this pattern-level, not a config catalog.]
47+
48+
## Optional Ports and Adapters Rules
49+
50+
[If the project benefits from hexagonal architecture, capture consumer-owned ports, adapter translation boundaries, transaction/side-effect ownership, and read/query seams. Keep it pragmatic and avoid interfaces or layers created only for symmetry.]
51+
4452
---
4553
_Document standards and patterns, not every dependency_

.kiro/specs/bun-database-abstraction/design.md renamed to .kiro/specs/archive/bun-database-abstraction/design.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,19 @@ internal/
120120
│ │ ├── store.go # Add postgres store branch
121121
│ │ └── bunstore/
122122
│ │ ├── store.go # Bun-backed b2bua.Store implementation
123-
│ │ ├── schema.go # Dialect-aware continuity DDL
123+
│ │ ├── 20250426000000_continuity_baseline.go # Bun migrate baseline DDL (caller filename → migration id)
124124
│ │ └── store_test.go # Contract and parity tests
125125
│ └── securesession/
126126
│ ├── adapters/
127127
│ │ └── bunstore/
128128
│ │ ├── store.go # Bun-backed app.Store implementation
129-
│ │ ├── schema.go # Dialect-aware secure-session DDL
129+
│ │ ├── 20250426000000_securesession_baseline.go # Bun migrate baseline DDL (caller filename → migration id)
130130
│ │ ├── models.go # Bun row models and scan/convert helpers
131131
│ │ └── store_test.go
132132
│ └── storecontract/
133133
│ └── bun_contract_test.go # Contract entry for Bun-backed store
134134
└── archtest/
135-
└── db_abstraction_boundaries_test.go # Optional import guardrail
135+
└── database_abstraction_imports_test.go # Optional import guardrail
136136
```
137137

138138
### Modified Files

.kiro/specs/bun-database-abstraction/requirements.md renamed to .kiro/specs/archive/bun-database-abstraction/requirements.md

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)