Repository navigation
feat(core): contracts, domain, ports, blocs, and DI skeleton (M1) - #32
Merged
Merged
Conversation
- Replace github.com/alteri-one/alteri-one with github.com/dip-develop/alteri-one across pubspecs, READMEs, and community files (closes open question Q4). - Pin build_runner to >=2.16.1 <2.17.0: 2.17.0 is retracted on pub.dev and 2.17.1 needs build 5 while injectable_generator 3.x needs build ^4. Signed-off-by: Dmytro Prylutskyi <dmytro.prylutskyi@outlook.com>
Implements the interface skeleton per docs/spec/domain.md (sections 8-9), docs/spec/contracts.md (section 10), and docs/spec/dart-language.md (section 7): packages/contracts: - Risk, ToolSpec (interim hand-written form pending spike T2) - sealed AgentEvent hierarchy with JSON round-trip and UnknownEvent fallback - ApiErrorCode constants, ApiError, ExtensionManifest/ExtensionProvides alteri_one_core: - domain: transition() state machine, PolicyGate.decide (capability -> taint -> profile rules), effectiveRisk, RunCapabilities.narrow, Budget, Invocation, typed IDs, Message/Turn/ToolCall/ToolResultBlock, CancelToken, memory, ContextFragment, TriggerEvent with chain depth - ports: LlmPort, JournalPort, MemoryPort, ToolPort (abstract interface class) - application: RunBloc, ApprovalsBloc, ExtensionsBloc, SchedulerBloc (droppable), TriggersCubit, ChannelsCubit, StatePublisher stub, applyBlocDefaults - DI: configureCore(environment) with dev/prod/test; fail-closed PolicyGate Tests: full transition matrix incl. invalid transitions, all PolicyGate branches, capabilities boundaries, event JSON round-trip, RunBloc lifecycle under bloc_test (closes T14), component and DI suites. melos run ci green. Findings recorded in docs/spec/open-questions.md and docs/plan/M1.md: - T21: bloc 9 runs each on<E>() as a separate subscription; cross-type ordering requires the static Bloc.transformer plus a single handler per bloc. - Q5: public_member_api_docs cannot see primary-constructor parameter docs. - Q6: verified new-constructor syntax differs from dart-language.md section 7.3. Signed-off-by: Dmytro Prylutskyi <dmytro.prylutskyi@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the full interface skeleton from the specification — no business logic yet; every method that performs effects is a documented stub for M2.
packages/contracts:Risk,ToolSpec(interim hand-written form pending schemantic spike T2), sealedAgentEventhierarchy with hand-written JSON round-trip andUnknownEventfallback, protocol error codes,ExtensionManifest.alteri_one_coredomain (pure Dart):transition()state machine,PolicyGate.decide()with the fixed check order (capability → taint → profile rules),effectiveRisk,RunCapabilities.narrow(),Budget,Invocation, typed IDs,Message/Turn/ToolCall,CancelToken, memory and context types,TriggerEventchain depth.alteri_one_coreports:LlmPort,JournalPort,MemoryPort,ToolPortasabstract interface class.RunBloc,ApprovalsBloc,ExtensionsBloc,SchedulerBlocwithdroppable(),TriggersCubit,ChannelsCubit),StatePublisherstub,applyBlocDefaults().configureCore(environment)fordev/prod/test; injectable-generated config committed;PolicyGateregistered fail-closed.Also carries two chore fixes that predate this branch: repository URLs normalized to
dip-develop/alteri-one(closes Q4) andbuild_runnerpinned to>=2.16.1 <2.17.0(2.17.0 retracted on pub.dev; 2.17.1 needs build 5 whileinjectable_generator3.x needs build ^4).Specification
docs/spec/domain.md§8.1–8.10,docs/spec/contracts.md§10.1–10.5,docs/spec/dart-language.md§7docs/spec/open-questions.mddocs/spec/open-questions.mdupdated;docs/plan/M1.mdcreated and checked offTests
InvalidTransitionPolicyGate.decidebranches (fail-closed defaults, taint rules, ask→deny without a channel)RunCapabilities.narrow/effectiveRiskboundaries;Budget.standard()pinned to the spec valuesAgentEventJSON round-trips; unknown event types degrade toUnknownEventRunBloclifecycle underbloc_test(closes T14); component and DI suitesmelos run cigreen locally (format, analyze --fatal-infos, arch, 144+ tests)Notable implementation findings (review focus)
on<E>()is a separate subscription; per-handlersequential()never orders events across types. The composition root setsBloc.transformer = sequential()once (applyBlocDefaults()), andRunBloc/ApprovalsBloc/ExtensionsBlocuse a single handler with an exhaustiveswitchover their sealed event types. Section 8.10 rule 4 should be rewritten accordingly.///docs to primary-constructor parameters, sopublic_member_api_docsis omitted from the shared lint set (dartdoc stays mandatory by convention perpackages/AGENTS.md).newconstructor forms differ from dart-language.md §7.3 (space instead of dot for namednew, type-less named factories, no namednewfactories).Checklist
git commit -s, DCO) and follow Conventional Commitsmelos run gen, not edited by handdocs/spec/architecture.md(get_itis injectable's runtime container)