Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ dotnet test --filter "FullyQualifiedName~TestClassName.TestMethodName"
dotnet run --project InventarWorkerService/InventarWorkerService.csproj
dotnet test InventarWorkerServiceIntegrationTest/InventarWorkerServiceIntegrationTest.csproj

# Collect coverage (CI gate >=70%, target >=80%)
dotnet test --collect:"XPlat Code Coverage" --results-directory ./TestResults

# Check package currency
dotnet list package --outdated

# Regenerate documentation when API/XML docs change
docfx docfx.json
```
Expand All @@ -32,7 +38,7 @@ docfx docfx.json

## Architecture

This is a .NET 9.0 multi-project solution for cross-platform IT hardware/software inventory.
This is a .NET 10 / C# 14.0 multi-project solution for cross-platform IT hardware/software inventory.

**Data flow:**
```
Expand Down Expand Up @@ -64,10 +70,16 @@ Each machine runs InventarWorkerService (REST agent)

**Nullable reference types** are enabled everywhere — use `string?` for optional values.

**Toolchain:** Use `.NET 10` with `C# 14.0`.

**Async:** All I/O-bound public service methods return `Task` or `Task<T>`.

**Coverage:** CI coverage must be >=70% and must target >=80%.

**Serialization:** `System.Text.Json` with camelCase naming policy throughout. Do not use Newtonsoft.Json.

**Dependencies:** Keep NuGet packages on latest stable versions; document any pinning exceptions.

**HTTP client:** RestSharp in `InventarViewerApp`; integration tests use Playwright's `APIRequestContext`.

**Data access:** Dapper + `Microsoft.Data.Sqlite`. SQL is written as explicit raw strings with `IF NOT EXISTS` guards, PascalCase identifiers, and indices on frequently queried columns.
Expand Down
55 changes: 32 additions & 23 deletions .specify/memory/constitution.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<!--
Sync Impact Report
- Version change: 1.0.0 -> 2.0.0
- Version change: 2.0.0 -> 2.1.0
- Modified principles:
- I. Shared Domain and Layer Boundaries (NON-NEGOTIABLE)
-> I. Didaktische und sprachliche Klarheit (Pedagogical and Linguistic Clarity)
- II. C# Quality and Language Conventions
-> II. Shared Domain and Layer Boundaries (NON-NEGOTIABLE)
- III. Testability and Regression Safety
-> III. Documentation Completeness and Learning-First Standards (NON-NEGOTIABLE)
- IV. Data, Serialization, and Persistence Consistency
-> V. Data, Serialization, and Persistence Consistency
- V. Branching and Pull Request Governance (NON-NEGOTIABLE)
-> VI. Branching and Pull Request Governance (NON-NEGOTIABLE)
- Added sections:
- IV. Testability and TDD Discipline
-> IV. Testability, TDD, and Coverage Discipline
- Added VII. Toolchain and Dependency Currency
- Added sections:
- None
- Removed sections:
- None
- Templates requiring updates:
Expand All @@ -26,6 +19,7 @@ Sync Impact Report
- CLAUDE.md: ✅ updated
- GEMINI.md: ✅ updated
- .github/copilot-instructions.md: ✅ updated
- README.md: ✅ updated
- Follow-up TODOs:
- None
-->
Expand Down Expand Up @@ -65,16 +59,18 @@ Didactically relevant non-public members, variables, and complex control paths M
carry bilingual block or line comments where XML documentation is not applicable.
Rationale: documentation is a first-class training artifact and must stay executable.

### IV. Testability and TDD Discipline
### IV. Testability, TDD, and Coverage Discipline
Tests MUST use MSTest attributes and descriptive method names in the
`<UnitUnderTest>_<Scenario>_<ExpectedOutcome>` pattern. New feature work MUST start
with failing tests (Red), then implementation to passing tests (Green), then cleanup
(Refactor), unless an explicit exception is documented in the plan's complexity section.
Unit tests MUST be deterministic and independent of machine-specific state. Any API
contract change, new endpoint, or cross-service integration behavior MUST include or
update integration tests.
Rationale: explicit Red-Green-Refactor behavior is required as teaching and quality
baseline.
update integration tests. Coverage for changed code paths MUST be at least 70% in CI.
Coverage of 80% or higher MUST be actively targeted; if a PR lands between 70% and 80%,
the PR MUST include an explicit follow-up item with owner and due date.
Rationale: explicit Red-Green-Refactor behavior and coverage gates reduce regression
risk while keeping improvements measurable.

### V. Data, Serialization, and Persistence Consistency
JSON serialization MUST use `System.Text.Json` with camelCase naming policy; new
Expand All @@ -94,10 +90,19 @@ touched projects, test evidence, and config/API impact; UI-impacting changes in
Rationale: branch protection and documented review gates are mandatory for controlled
integration.

### VII. Toolchain and Dependency Currency
Repository work MUST target .NET 10 and C# 14.0 for new or migrated projects. NuGet
packages MUST be kept on latest stable versions as part of regular delivery. If a
package must stay behind latest stable due compatibility or vendor issues, the PR MUST
document package name, pinned version, rationale, and next review date.
Rationale: current toolchains and dependencies reduce security exposure and maintenance
cost.

## Implementation Constraints

- C# naming conventions (`PascalCase`, `camelCase`, `_camelCase`) and nullable
reference types MUST remain enabled.
- Toolchain baseline MUST be `.NET 10` with `LangVersion` set to `14.0`.
- Runtime model MUST stay cross-platform: Windows Service (`AddWindowsService`),
systemd (`AddSystemd`), and launchd compatibility.
- Worker loop timing MUST remain `30_000ms` in debug and `86_400_000ms` in release,
Expand All @@ -114,15 +119,19 @@ integration.
1. Create a new working branch before implementation. Work on `main` for feature
development is prohibited.
2. Define or update feature specification, plan, and tasks with a constitution check
that covers bilingual B2 documentation, XML completeness, TDD, and layering rules.
covering bilingual B2 documentation, XML completeness, TDD, coverage, layering, and
dependency currency.
3. Implement code in the project-specific location defined by Principle II.
4. Run relevant validation commands at minimum:
`dotnet build InventarWorkerService.sln`, applicable `dotnet test` scope, and
`docfx docfx.json` whenever API signatures/XML docs or documentation content changed.
4. Run validation commands at minimum:
`dotnet restore InventarWorkerService.sln`,
`dotnet build InventarWorkerService.sln`,
`dotnet test` with coverage collection,
`dotnet list package --outdated`,
and `docfx docfx.json` whenever API signatures/XML docs or documentation content
changed.
5. Open a pull request to `main` with required evidence and ensure constitution
compliance is reviewed before merge.
6. Perform a final documentation compliance review; missing documentation MUST be added
before merge.
6. Perform a final documentation and coverage compliance review before merge.

## Governance

Expand All @@ -137,4 +146,4 @@ versioning for governance:
Compliance review is mandatory in planning and code review; unresolved violations MUST
be documented in the implementation plan's complexity tracking section.

**Version**: 2.0.0 | **Ratified**: 2026-03-08 | **Last Amended**: 2026-03-08
**Version**: 2.1.0 | **Ratified**: 2026-03-08 | **Last Amended**: 2026-03-08
3 changes: 3 additions & 0 deletions .specify/templates/commands/checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Use this command to generate review checklists for a feature or release.
- branch/PR compliance
- constitution gate compliance
- test evidence completeness
- coverage evidence (`>=70%` minimum, `>=80%` target tracking)
- .NET 10 + C# 14.0 toolchain alignment
- NuGet dependency currency / pinning documentation
- documentation completeness (bilingual + XML + DocFX when required)

## Validation Checklist
Expand Down
5 changes: 5 additions & 0 deletions .specify/templates/commands/constitution.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ Use this command when governance or project rules change.
- `GEMINI.md`
- `.github/copilot-instructions.md`
5. Ensure no unresolved placeholders remain in the constitution.
6. Verify toolchain, coverage, and dependency governance alignment:
- `.NET 10` + `C# 14.0`
- coverage gate `>=70%` with target `>=80%`
- NuGet packages tracked against latest stable versions

## Validation Checklist

- Version line and Sync Impact Report are consistent.
- Dates are ISO `YYYY-MM-DD`.
- Principles are declarative and auditable.
- `main` protection workflow is respected (new branch + PR).
- Toolchain/coverage/dependency rules are reflected in templates and guidance files.
5 changes: 4 additions & 1 deletion .specify/templates/commands/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ Use this command to produce an implementation plan from an approved specificatio
1. Populate technical context with real stack details.
2. Execute the Constitution Check gates explicitly:
- branching and PR flow
- .NET 10 + C# 14.0 toolchain alignment
- architecture/layer boundaries
- bilingual CEFR B2 documentation scope
- XML documentation + DocFX regeneration scope
- Red-Green-Refactor testing scope
- coverage gate (`>=70%` minimum, `>=80%` target)
- NuGet dependency currency and pinning exceptions
- serialization/data conventions
3. Document concrete project structure for this feature.
4. Record justified exceptions in Complexity Tracking.

## Validation Checklist

- No gate is left unresolved without rationale.
- Test and documentation impacts are planned before implementation.
- Test, coverage, dependency, and documentation impacts are planned before implementation.
4 changes: 4 additions & 0 deletions .specify/templates/commands/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Use this command to create or update a feature specification.
2. Fill `spec.md` with prioritized, independently testable user stories.
3. Define measurable outcomes and explicit edge cases.
4. Fill the Constitution Alignment section with concrete impacts:
- .NET 10 + C# 14.0 toolchain impact
- NuGet dependency currency impact
- coverage thresholds (`>=70%`, target `>=80%`)
- layering/shared logic placement
- bilingual documentation impact (German first, English second, CEFR B2)
- XML documentation and DocFX impact
Expand All @@ -19,3 +22,4 @@ Use this command to create or update a feature specification.
- Each story can be tested independently.
- Requirements are implementation-agnostic.
- Constitution alignment items are complete and non-empty.
- Toolchain/dependency/coverage constraints are explicit and measurable.
6 changes: 5 additions & 1 deletion .specify/templates/commands/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ Use this command to generate an executable task list from `plan.md` and `spec.md
- bilingual updates (German block first, then English)
- XML documentation completeness
- `docfx docfx.json` run when API/XML docs changed
4. Include PR preparation task (purpose, touched projects, test evidence, config/API impact).
4. Include coverage and dependency tasks:
- coverage evidence for `>=70%` minimum and `>=80%` target tracking
- `dotnet list package --outdated` review and update tasks
5. Include PR preparation task (purpose, touched projects, test evidence, config/API impact).

## Validation Checklist

- Every code change has corresponding tests.
- Documentation and governance tasks are present.
- Task ordering supports incremental, verifiable delivery.
- Coverage and dependency currency tasks are explicitly scheduled.
13 changes: 10 additions & 3 deletions .specify/templates/plan-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
the iteration process.
-->

**Language/Version**: [e.g., Python 3.11, Swift 5.9, Rust 1.75 or NEEDS CLARIFICATION]
**Language/Version**: [C# 14.0 on .NET 10 or NEEDS CLARIFICATION]
**Primary Dependencies**: [e.g., FastAPI, UIKit, LLVM or NEEDS CLARIFICATION]
**Storage**: [if applicable, e.g., PostgreSQL, CoreData, files or N/A]
**Testing**: [e.g., pytest, XCTest, cargo test or NEEDS CLARIFICATION]
**Testing**: [MSTest + coverage gates (>=70% minimum, target >=80%) or NEEDS CLARIFICATION]
**Target Platform**: [e.g., Linux server, iOS 15+, WASM or NEEDS CLARIFICATION]
**Project Type**: [e.g., library/cli/web-service/mobile-app/compiler/desktop-app or NEEDS CLARIFICATION]
**Performance Goals**: [domain-specific, e.g., 1000 req/s, 10k lines/sec, 60 fps or NEEDS CLARIFICATION]
Expand All @@ -31,7 +31,14 @@

*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*

[Gates determined based on constitution file]
- Branching Gate: Implementation branch is newly created and is not `main`; merge path is PR to `main`.
- Toolchain Gate: Change scope explicitly targets .NET 10 and C# 14.0 (`LangVersion` 14.0).
- Architecture Gate: Shared logic stays in `InventarWorkerCommon`; runtime-specific logic stays in owning app/service.
- Documentation Gate: Bilingual documentation (German block first, English block second) and CEFR B2 readability are planned.
- XML/DocFX Gate: XML documentation completeness and `docfx docfx.json` regeneration scope are defined.
- Testing/Coverage Gate: Red-Green-Refactor tasks are identified and coverage plan enforces >=70% minimum with >=80% target.
- Dependency Currency Gate: NuGet update strategy is defined; package pinning exceptions are documented with review date.
- Data Contract Gate: `System.Text.Json` camelCase, Dapper SQL conventions, and schema/index rules are preserved.

## Project Structure

Expand Down
12 changes: 12 additions & 0 deletions .specify/templates/spec-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@
- **FR-006**: System MUST authenticate users via [NEEDS CLARIFICATION: auth method not specified - email/password, SSO, OAuth?]
- **FR-007**: System MUST retain user data for [NEEDS CLARIFICATION: retention period not specified]

## Constitution Alignment *(mandatory)*

- **CA-001 Branching**: Feature work MUST be delivered from a new branch and merged via PR to `main`.
- **CA-002 Toolchain**: Feature scope MUST specify .NET 10 + C# 14.0 impact and migration needs.
- **CA-003 Dependency Currency**: Spec MUST define NuGet update impact and any justified pinning exceptions.
- **CA-004 Coverage**: Spec MUST define how CI coverage meets >=70% minimum and tracks >=80% target.
- **CA-005 Layering**: Shared domain/service logic impact MUST identify changes in `InventarWorkerCommon` vs app-specific projects.
- **CA-006 Linguistic Rules**: Spec MUST define bilingual documentation scope (German first, English second) at CEFR B2.
- **CA-007 Documentation Enforcement**: Spec MUST identify XML documentation impact and whether a `docfx docfx.json` run is required.
- **CA-008 Testing Impact**: Spec MUST define Red-Green-Refactor coverage and required unit/integration tests.
- **CA-009 Data Contracts**: Spec MUST identify JSON serialization and SQL schema/index implications when data is affected.

### Key Entities *(include if feature involves data)*

- **[Entity 1]**: [What it represents, key attributes without implementation]
Expand Down
Loading
Loading