feat: implement Foundation V1 walking skeleton
CI / test (push) Successful in 7m31s

This commit is contained in:
m
2026-08-16 15:22:49 +03:00
commit 9b136621ef
205 changed files with 6345 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
# authority
**Owns:** Scope and authority grant/validation semantics.
See `architecture/architecture-registry.yaml` for allowed dependencies and DB schema.
This module may not write another owner's canonical state. Domain code does not import adapters/runtime/providers.
+3
View File
@@ -0,0 +1,3 @@
package application
// Package application coordinates authority-owned use cases through explicit ports.
+22
View File
@@ -0,0 +1,22 @@
package domain
import (
"errors"
"git.cin.su/m/Assistant/contracts/authority"
"git.cin.su/m/Assistant/contracts/identity"
)
var ErrInvalidCreatorGrant = errors.New("creator grant must be active, global, and revisioned")
// ValidateCreatorGrant validates the narrow bootstrap authority used by
// Domovoy. Execution paths must still perform their own target/revision checks.
func ValidateCreatorGrant(binding identity.PrincipalBinding, scope authority.Scope, grant authority.AuthorityGrant) error {
if binding.ActorID == "" || binding.PrincipalID == "" || !binding.Active ||
!scope.Global || scope.ID == "" ||
grant.ID == "" || grant.Class != authority.GrantClassCreator || !grant.Active || grant.Revision == 0 ||
grant.ActorID != binding.ActorID || grant.PrincipalID != binding.PrincipalID || grant.ScopeID != scope.ID {
return ErrInvalidCreatorGrant
}
return nil
}
+3
View File
@@ -0,0 +1,3 @@
package domain
// Package domain contains authority domain meaning only. It must not import adapters or runtime packages.
+19
View File
@@ -0,0 +1,19 @@
package domain
import (
"errors"
"git.cin.su/m/Assistant/contracts/authority"
"git.cin.su/m/Assistant/contracts/identity"
)
var ErrInvalidGrant = errors.New("authority grant is not currently valid for actor, principal, and scope")
func ValidateGrant(binding identity.PrincipalBinding, scope authority.Scope, grant authority.AuthorityGrant) error {
if binding.ActorID == "" || binding.PrincipalID == "" || !binding.Active ||
scope.ID == "" || grant.ID == "" || grant.Revision == 0 || !grant.Active ||
grant.ActorID != binding.ActorID || grant.PrincipalID != binding.PrincipalID || grant.ScopeID != scope.ID {
return ErrInvalidGrant
}
return nil
}
+4
View File
@@ -0,0 +1,4 @@
package authority
// Module is an intentionally minimal V1 composition handle. Do not turn it into a God service.
type Module struct{}
+3
View File
@@ -0,0 +1,3 @@
package ports
// Package ports declares authority-owned external dependencies. Ports must be narrow and semantic.