Compare commits

..

10 Commits

Author SHA1 Message Date
José René White Enciso
5fc02886cf chore(building-block-inventory): checkpoint pending development updates 2026-03-09 11:57:46 -06:00
José René White Enciso
e663c39cb7 chore(repo): normalize ignore policy and repository metadata paths 2026-03-06 08:17:46 -06:00
José René White Enciso
76295ee046 Merge branch 'feature/inventory-stable-package-baseline' into development 2026-02-25 16:50:50 -06:00
José René White Enciso
5e8c9e100f refactor(building-block-inventory): consume blueprint common via package 2026-02-25 16:17:53 -06:00
José René White Enciso
9a1dd45931 chore(building-block-inventory): stabilize package metadata and version baseline 2026-02-25 15:54:44 -06:00
José René White Enciso
3878c46657 merge(building-block-inventory): integrate inventory-contracts-package-baseline 2026-02-25 14:41:57 -06:00
José René White Enciso
f82bab022a docs(building-block-inventory): add nuget publication baseline 2026-02-25 14:07:55 -06:00
José René White Enciso
2ed6ba885d chore(building-block-inventory): merge contract integration branch 2026-02-22 04:56:44 -06:00
José René White Enciso
b24d4009ed feat(contracts): add transport-neutral inventory contracts
- WHY: align inventory capability contracts with protocol-agnostic integration boundaries
- WHAT: add contract conventions, grpc adapter surfaces, and blueprint descriptor consumption
- RULE: enforce building-block to blueprint dependency direction
2026-02-22 02:57:11 -06:00
José René White Enciso
c1cef614ba chore(tasks): untrack local task files
- WHY: keep task lifecycle files local-only per gitignore policy
- WHAT: remove tracked .tasks entries from repository index
- RULE: apply repository workflow task folder behavior
2026-02-22 01:34:56 -06:00
16 changed files with 177 additions and 140 deletions

58
.gitignore vendored
View File

@ -1,53 +1,23 @@
# AgileWebs local orchestration
# Repository orchestration folders (local only)
.repo-tasks/
.repo-context/
.tasks/
.agile/
# Build artifacts
**/[Bb]in/
**/[Oo]bj/
/**/out/
/**/artifacts/
# IDE and editor files
# .NET build outputs
**/bin/
**/obj/
.vs/
.idea/
.vscode/
*.suo
TestResults/
**/TestResults/
*.user
*.userosscache
*.sln.docstates
*.suo
*.rsuser
*.swp
*.swo
# NuGet
# IDE
.idea/
# Package artifacts
*.nupkg
*.snupkg
**/packages/*
!**/packages/build/
# Test output
**/TestResults/
*.trx
*.coverage
*.coveragexml
# Logs
*.log
logs/
# Local environment files
.env
.env.*
!.env.example
# Docker
.docker/
**/.docker/
*.pid
docker-compose.override.yml
docker-compose.*.override.yml
# OS files
.DS_Store
Thumbs.db
artifacts/

View File

@ -1,86 +0,0 @@
# Stage 1 Task
## 0. Header
- Task ID: TASK-20260222-001
- Title: Define inventory capability contract boundaries
- Status: Planned
- Priority: P1
- Target Repo: building-block-inventory
- Target Branch: feature/building-block-inventory-001
- Related Master Plan: plan/master-stage1-structural-normalization-2026-02-22.md
- Related Mini Plan: plan/building-block-inventory-mini-plan.md
## 1. Goal (What and Why)
### What
- Catalog inventory contract entities and request-response shapes
- Separate capability contracts from implementation concerns
### Why
- Inventory building block must remain contracts-only
## 2. Scope
### In Scope
- Contract ownership and boundary rules for inventory capability
### Out of Scope
- Provider or repository implementation details
## 3. Constraints (Non-Negotiable)
- Stage 1 planning only. No implementation changes.
- Do not modify any file under legacy.
- Do not run repo provisioning or CI generation.
- Follow the approved architecture boundaries and protocol policy.
- Keep identity abstractions inside Thalos repositories.
## 4. Documentation Requirement
- [ ] Capture planning decisions clearly for handoff.
- [ ] Identify documentation and diagram updates expected in later stages.
## 5. Context
- This task derives from plan/building-block-inventory-mini-plan.md.
- This task must remain decision-focused and implementation-ready.
## 6. Proposed Approach
- Define an ownership catalog for inventory capability contracts
## 7. Execution Steps
1. Review legacy evidence relevant to this task scope.
2. Define target boundary decisions and contract implications.
3. Record risks, dependencies, and compatibility notes.
4. Produce clear handoff guidance for implementation stage.
## 8. Acceptance Criteria
- [ ] Decisions are explicit, scoped, and actionable.
- [ ] Ownership boundaries are unambiguous.
- [ ] Protocol policy alignment is explicit where applicable.
- [ ] No forbidden Stage 1 actions were performed.
## 9. Testing Plan
### Unit Tests
- Not applicable for Stage 1 planning artifacts.
### Validation
- Ensure consistency with master plan and mini plan.
## 10. Definition of Done
- [ ] Task content is complete and consistent with other task files.
- [ ] References to master and mini plans are correct.
- [ ] Handoff notes are clear enough for immediate implementation.
## 11. Risks and Questions
- Risk: boundary drift during implementation.
- Mitigation: enforce repo intent metadata and mini plan ownership.
## 12. Handoff Notes
- Preserve approved constraints exactly.
- Implementers should execute this task only after reading master and mini plans.
END OF TASK
## 13. Completion Metadata
- Completion Stage: Stage 3 Execution
- Completed On: 2026-02-22
- Completed By: Codex
- Completion Branch: feature/building-block-inventory-001
- Completion Commit: b0cddfe
- Lifecycle State: done

10
Directory.Build.props Normal file
View File

@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<Authors>AgileWebs</Authors>
<Company>AgileWebs</Company>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://gitea.dream-views.com/AgileWebs/building-block-inventory</RepositoryUrl>
<PackageProjectUrl>https://gitea.dream-views.com/AgileWebs/building-block-inventory</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
</PropertyGroup>
</Project>

View File

@ -3,15 +3,23 @@ skinparam packageStyle rectangle
package "building-block-inventory" {
package "BuildingBlock.Inventory.Contracts" {
class Conventions
class Requests
class Responses
interface Adapters
class Grpc
interface Abstractions
}
}
package "blueprint-platform" {
interface IBlueprintPackageContract
}
package "furniture-service" as FurnitureService
package "furniture-bff" as FurnitureBff
Conventions ..> IBlueprintPackageContract
FurnitureService --> Requests
FurnitureService --> Responses
FurnitureBff --> Requests

View File

@ -4,14 +4,18 @@
- `BuildingBlock.Inventory.Contracts`
## Current Contract Groups
## Contract Groups
- `Conventions`: transport-neutral request/response and envelope conventions.
- `Requests`: capability request shapes for inventory use cases.
- `Responses`: capability response shapes for inventory use cases.
- `Abstractions`: marker abstractions for inventory contract ownership.
- `Adapters`: protocol adapter boundaries.
- `Grpc`: gRPC contract shapes for adapter translation.
## Ownership Boundary
- This repository owns inventory capability contracts only.
- Contract metadata consumes `Core.Blueprint.Common.Contracts` and does not redefine Blueprint contracts.
- Implementation details stay in furniture-service, furniture-bff, or furniture-dal.
- Identity abstractions are out of scope and remain Thalos-owned.

View File

@ -6,7 +6,12 @@
- Breaking changes require a new major package version.
- Deprecated members should remain for at least one release cycle.
## Blueprint Compatibility
- Package descriptor metadata is implemented via `IBlueprintPackageContract` from `Core.Blueprint.Common.Contracts`.
- Inventory contracts consume Blueprint common contract primitives rather than redefining them.
## Compatibility Notes
- Consumer repositories (`furniture-service`, `furniture-bff`) should update contracts explicitly.
- Transport adapters remain outside this contracts package.
- Protocol adapters remain edge concerns; inventory contracts remain transport-neutral.

View File

@ -0,0 +1,29 @@
# Inventory Contracts NuGet Publication Baseline
## Feed
- Source: `https://gitea.dream-views.com/api/packages/AgileWebs/nuget/index.json`
- Authentication: Gitea login + token
- HTTP requirement: `allowInsecureConnections="true"` in `nuget.config`
## Stable Version Matrix
| Package | Version | Published On |
| --- | --- | --- |
| BuildingBlock.Inventory.Contracts | 0.2.0 | 2026-02-25 |
## Dependency Note
`BuildingBlock.Inventory.Contracts` depends on:
- `Core.Blueprint.Common` version `0.2.0`
Stable package waves must keep dependency versions aligned.
## Consumer Validation
Restore validation passed using:
- `TargetFramework`: `net10.0`
- `PackageReference`: `BuildingBlock.Inventory.Contracts` `0.2.0`
- Restore flags: `--no-cache --force`

View File

@ -0,0 +1,25 @@
using BuildingBlock.Inventory.Contracts.Grpc;
using BuildingBlock.Inventory.Contracts.Requests;
using BuildingBlock.Inventory.Contracts.Responses;
namespace BuildingBlock.Inventory.Contracts.Adapters;
/// <summary>
/// Defines adapter boundary for gRPC contract translation.
/// </summary>
public interface IInventoryGrpcContractAdapter
{
/// <summary>
/// Maps transport-neutral request into gRPC contract shape.
/// </summary>
/// <param name="request">Transport-neutral inventory lookup request.</param>
/// <returns>gRPC contract request shape.</returns>
InventoryItemLookupGrpcContract ToGrpcRequest(InventoryItemLookupRequest request);
/// <summary>
/// Maps gRPC contract response data into transport-neutral response.
/// </summary>
/// <param name="contract">gRPC contract response shape.</param>
/// <returns>Transport-neutral inventory lookup response.</returns>
InventoryItemLookupResponse FromGrpcResponse(InventoryItemLookupGrpcContract contract);
}

View File

@ -4,4 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Core.Blueprint.Common" Version="0.2.0" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,9 @@
namespace BuildingBlock.Inventory.Contracts.Conventions;
/// <summary>
/// Defines transport-neutral request contract shape for inventory capability operations.
/// </summary>
/// <typeparam name="TResponse">Response contract type.</typeparam>
public interface IInventoryContractRequest<out TResponse>
{
}

View File

@ -0,0 +1,8 @@
namespace BuildingBlock.Inventory.Contracts.Conventions;
/// <summary>
/// Defines transport-neutral envelope metadata for inventory contract messages.
/// </summary>
/// <param name="ContractVersion">Contract schema version.</param>
/// <param name="CorrelationId">Correlation identifier for cross-service tracing.</param>
public sealed record InventoryContractEnvelope(string ContractVersion, string CorrelationId);

View File

@ -0,0 +1,15 @@
using Core.Blueprint.Common.Contracts;
namespace BuildingBlock.Inventory.Contracts.Conventions;
/// <summary>
/// Defines package descriptor metadata for inventory contracts package.
/// </summary>
public sealed class InventoryPackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"BuildingBlock.Inventory.Contracts",
PackageVersionPolicy.Minor,
["Core.Blueprint.Common"]);
}

View File

@ -0,0 +1,7 @@
namespace BuildingBlock.Inventory.Contracts.Grpc;
/// <summary>
/// Defines minimal gRPC contract shape for adapter-level translation.
/// </summary>
/// <param name="ItemCode">External item identifier.</param>
public sealed record InventoryItemLookupGrpcContract(string ItemCode);

View File

@ -1,7 +1,13 @@
using BuildingBlock.Inventory.Contracts.Conventions;
namespace BuildingBlock.Inventory.Contracts.Requests;
/// <summary>
/// Represents the contract request to lookup an inventory item.
/// Represents the transport-neutral contract request to lookup an inventory item.
/// </summary>
/// <param name="Envelope">Contract envelope metadata.</param>
/// <param name="ItemCode">External item identifier.</param>
public sealed record InventoryItemLookupRequest(string ItemCode);
public sealed record InventoryItemLookupRequest(
InventoryContractEnvelope Envelope,
string ItemCode)
: IInventoryContractRequest<Responses.InventoryItemLookupResponse>;

View File

@ -1,8 +1,14 @@
using BuildingBlock.Inventory.Contracts.Conventions;
namespace BuildingBlock.Inventory.Contracts.Responses;
/// <summary>
/// Represents the contract response for an inventory item lookup.
/// Represents the transport-neutral contract response for an inventory item lookup.
/// </summary>
/// <param name="Envelope">Contract envelope metadata.</param>
/// <param name="ItemCode">External item identifier.</param>
/// <param name="QuantityAvailable">Current quantity available.</param>
public sealed record InventoryItemLookupResponse(string ItemCode, int QuantityAvailable);
public sealed record InventoryItemLookupResponse(
InventoryContractEnvelope Envelope,
string ItemCode,
int QuantityAvailable);

View File

@ -1,24 +1,42 @@
using BuildingBlock.Inventory.Contracts.Conventions;
using BuildingBlock.Inventory.Contracts.Requests;
using BuildingBlock.Inventory.Contracts.Responses;
using Core.Blueprint.Common.Contracts;
namespace BuildingBlock.Inventory.Contracts.UnitTests;
public class ContractShapeTests
{
[Fact]
public void InventoryItemLookupRequest_WhenCreated_StoresItemCode()
public void InventoryItemLookupRequest_WhenCreated_StoresTransportNeutralData()
{
var request = new InventoryItemLookupRequest("SKU-001");
var envelope = new InventoryContractEnvelope("1.0.0", "corr-123");
var request = new InventoryItemLookupRequest(envelope, "SKU-001");
Assert.Equal("1.0.0", request.Envelope.ContractVersion);
Assert.Equal("corr-123", request.Envelope.CorrelationId);
Assert.Equal("SKU-001", request.ItemCode);
}
[Fact]
public void InventoryItemLookupResponse_WhenCreated_StoresContractData()
public void InventoryItemLookupResponse_WhenCreated_StoresTransportNeutralData()
{
var response = new InventoryItemLookupResponse("SKU-001", 5);
var envelope = new InventoryContractEnvelope("1.0.0", "corr-123");
var response = new InventoryItemLookupResponse(envelope, "SKU-001", 5);
Assert.Equal("1.0.0", response.Envelope.ContractVersion);
Assert.Equal("corr-123", response.Envelope.CorrelationId);
Assert.Equal("SKU-001", response.ItemCode);
Assert.Equal(5, response.QuantityAvailable);
}
[Fact]
public void InventoryPackageContract_WhenCreated_UsesBlueprintDescriptorContract()
{
IBlueprintPackageContract contract = new InventoryPackageContract();
Assert.Equal("BuildingBlock.Inventory.Contracts", contract.Descriptor.PackageId);
Assert.Equal(PackageVersionPolicy.Minor, contract.Descriptor.VersionPolicy);
Assert.Contains("Core.Blueprint.Common", contract.Descriptor.DependencyPackageIds);
}
}