Skip to content

feat(construct): hand records to the planner - #8

Open
nikbackdev wants to merge 1 commit into
construct-planner-promptfrom
construct-planner-handoff
Open

nikbackdev wants to merge 1 commit into
construct-planner-promptfrom
construct-planner-handoff

Conversation

@nikbackdev

@nikbackdev nikbackdev commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Description

Processing of a received record. The hand-off puts the record on a bounded queue in memory and refuses it when the queue is full or stopped, so intake answers 503 and keeps no identity. A worker processes at most planner.max_concurrent records at once until the gear stops. Each record goes through the profile read, the agent loop, the sensitive-data checks, Admission and the writer; on a write conflict it is planned again on a new read of the profile, up to planner.max_reruns, then dropped with rerun_limit. A failure drops the record once, with a content-free event.

The design is in gears/construct/docs/features/planner.md.

Review stack. All Construct PRs come from forks, so a stack of PRs with each base on the previous branch can only live in this fork. Each PR here shows its own change only. The bottom base, construct-base, is the sensitive-data checks and admission change (constructorfabric#5311, on top of constructorfabric#5248 and constructorfabric#5249) with main merged in. Merging goes through constructorfabric#5324, from the bottom up.

Not in this PR: the implementations of the profile read and the writer (graph storage, Profile Writer) and of the tenant context, which this PR takes as ports; wiring the queue into the gear in place of the stub that drops every record, which waits for those and for the admission rules from the settings service.

Testing

  • Unit tests pass
  • New tests added for new functionality

Also run locally: cargo fmt, cargo clippy -D warnings, cargo gears lint --dylint (cargo-gears 0.0.8), make check-release-config, gts-validator, cfs validate.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is documented with rustdoc comments

@nikbackdev
nikbackdev force-pushed the construct-planner-handoff branch 2 times, most recently from 827aa85 to 8d15c9d Compare October 13, 2026 14:56
@nikbackdev
nikbackdev force-pushed the construct-planner-prompt branch from 260efb4 to 4e78fb9 Compare October 13, 2026 14:56
@nikbackdev
nikbackdev force-pushed the construct-planner-handoff branch from 8d15c9d to 4d3e09c Compare October 13, 2026 15:08
@nikbackdev
nikbackdev force-pushed the construct-planner-prompt branch from 4e78fb9 to 2bdcf42 Compare October 15, 2026 00:54
@nikbackdev
nikbackdev force-pushed the construct-planner-handoff branch 2 times, most recently from 9236b9e to 99fa7f0 Compare October 15, 2026 02:35
@nikbackdev
nikbackdev force-pushed the construct-planner-prompt branch from 2bdcf42 to 8ad7c5d Compare October 15, 2026 02:35
@nikbackdev
nikbackdev force-pushed the construct-planner-handoff branch from 99fa7f0 to ae49a5d Compare October 19, 2026 13:45
@nikbackdev
nikbackdev force-pushed the construct-planner-prompt branch from 8ad7c5d to 9251ce1 Compare October 19, 2026 13:45
@nikbackdev
nikbackdev force-pushed the construct-planner-handoff branch 3 times, most recently from 832f6fa to e73d9c4 Compare October 21, 2026 16:20
The hand-off puts a received record on a bounded queue in memory and
refuses it when the queue is full or stopped, so intake answers 503 and
keeps no identity. A worker processes at most the given number of
records at once until the gear stops. The planner decides on chat
messages and fact candidates about a subject; any other record, a
mastery record or one without a subject, is dropped with not_planned
and never reaches the model. Processing reads the profile, plans, runs
the checks and Admission, and writes the admitted plan; on a write
conflict it plans again on a new read, up to the rerun limit, then
drops the record with rerun_limit. The profile read, the writer and the
tenant context are ports; their implementations, the config keys and
the wiring in place of the dropping stub come later.

Signed-off-by: Nikita <Nikita.Bazhenov@constructor.tech>
@nikbackdev
nikbackdev force-pushed the construct-planner-handoff branch from e73d9c4 to 037600e Compare October 23, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant