Skip to content

Questions and decisions

A task often leaves a gap. The agent can guess, or it can ask a person. Zentri lets the agent ask with zentri_ask and get a handle back at once, so it keeps working while it waits. The answer arrives later as a notice.

An agent also makes design choices that outlive the task, such as a data shape or a new dependency. It records each one with zentri_propose_decision as a decision, a record shaped like an architecture decision record (ADR). A low-risk decision is accepted at once. A high-risk one waits for a lead, and the merge check fails the session’s branch until a lead approves it.

Questions and decisions are separate records. An answer never becomes a decision. Agents ask and propose. Only people answer and review.

The agent calls zentri_ask with these fields.

Field What it holds
text The question, at most 1 KiB.
kind product for what to build, technical for how to build it.
context Optional background, at most 2 KiB.
options Optional choices, at most 6, each at most 200 bytes.
blocking true when the agent cannot go on without the answer.
fresh true to skip reusing an earlier answer.
question_id Sent alone, to check on a question the session asked before.

The call never waits for a person. It returns a status, the question_id, the recipient handle, expire_at, the answer when there is one, and a next line that tells the agent what to do.

status What happened What the agent does
pending A person was asked. Keeps working. The answer arrives as a question_answered notice.
answered A person answered, or an earlier answer was reused. Follows the answer. For a reuse that does not fit, asks again with fresh: true.
expired Nobody answered in time. Goes on with its best judgement and says so.

The coordinator redacts text that looks like a credential before it stores the question.

kind Sent to Who may answer
product The person who registered the session’s intent, else the session’s owner Any person with role requester or above
technical The session’s owner Any person with role engineer or above

When an engineer runs zt start, that engineer registered the intent, so both kinds go to them. When a requester registers work through Slack and an engineer starts it later, product questions go to the requester.

The recipient gets a question_asked notice. zt status and zt ls print it, and a Slack-linked recipient also gets a Slack message. The recipient reads the question phrased for their skill level. A session token can never answer.

Before it asks a person, the coordinator looks for an earlier answer that fits. It reuses one only when all of these hold:

  • The earlier question is in the same project, has the same kind, and is answered.
  • A person wrote that answer. A reused answer is never reused again.
  • Both questions were embedded by the same embedding model.
  • Their cosine similarity is at or above the project’s duplicate_cosine threshold. It defaults to 0.95 with a semantic embedder and 0.79 with the hash embedder, and a lead can calibrate it.

A reuse returns answered at once, asks nobody, and sends no question_asked notice. The answer records which answer it came from and the similarity. Send fresh: true to skip reuse.

The coordinator sweeps open questions every --sweep-interval (default 1m). Each deadline counts from the moment the agent asked.

Question Reminder Escalation Expiry
Blocking 15 minutes 1 hour 24 hours
Not blocking 4 hours 24 hours 7 days
  1. The reminder is a second question_asked notice to the recipient. It is sent once, and only if the question has not escalated yet.
  2. Escalation sends question_escalated to the org’s leads, except the recipient. An org with no lead notifies its admins. Escalation does not change who may answer.
  3. Expiry sets the status to expired and sends question_expired to the session.

The agent calls zentri_propose_decision with title (at most 200 bytes), context, decision, and consequences (each at most 4 KiB). It may add alternatives, a risk of low or high (default low), and supersedes, the ID of a decision this one replaces.

The coordinator never lowers the stated risk. When the agent says low, it reads the title and the decision text and raises the risk to high if either names one of these areas as a whole word, ignoring case.

Area Example words it matches
security security, secure, vulnerability, cve
authentication auth, login, sign-in, oauth, oidc, sso, saml, mfa, session token
permissions permission, privilege, access control, acl, rbac, grant
secrets secret, api key, private key
credentials credential, password, passphrase
encryption encrypt, decrypt, cipher, crypto, tls, certificate
a schema migration migration, migrate, schema change, alter table, drop column, add column
deleting data delete data, data loss, data retention, purge, truncate, wipe data
payments payment, billing, invoice, charge, refund, checkout, stripe, pci
a public API public api, external api, api contract, breaking change, webhook

A decision that supersedes a high-risk decision is high-risk too. The reply carries risk, risk_stated, and risk_reason, for example names payments, a schema migration or supersedes a high-risk decision.

Risk Status after proposing What follows
low accepted The decision it supersedes becomes superseded.
high proposed Leads other than the proposer get a decision_pending notice, and a second one if it is still proposed after 24 hours.

The proposer is the person who owns the session.

One person reviews a proposed decision, once. The reviewer must be a lead or an admin and must not be the proposer. A session token can never review. An approval sets the status to accepted and supersedes the decision it names. A rejection sets rejected. Either way the session and the proposer get a decision_decided notice. A second review gets 409 decision_not_proposed.

The merge check’s decision rule fails a session’s branch while one of the session’s high-risk decisions is proposed. It also fails while one is rejected and no accepted decision of the same session supersedes it. The finding names the decision by ID only.

- **decision**: high-risk decision `<id>` waits for a lead's review.
- **decision**: high-risk decision `<id>` was rejected, and no accepted decision of this session supersedes it.

A rejected decision keeps its status, so the rejection stays on record. To clear it, the agent proposes a new decision with supersedes set to the rejected one. That new decision is high-risk, so it also needs a lead.

zentri_search_decisions takes a query of at most 1 KiB, an optional status list (default accepted and proposed), and a limit (default 10, at most 20). It ranks by embedding similarity when the decisions share the query’s embedding model, and by text match otherwise. Each result carries id, title, status, risk, the decision text cut to 600 characters, supersedes, score, and created_at.

Answer the questions your role may answer.

Terminal window
zt questions # open questions your role may answer
zt questions --mine # only questions asked of you
zt questions show 0192f3a1
zt questions answer 0192f3a1 --option 2 # or --text "..."

Without --option or --text, zt shows the question and reads one line from the terminal. A number picks that option, and anything else is the free answer. With no terminal, pass --option or --text. scripts/e2e-m5.sh checks this output.

Terminal window
$ zt questions answer 0192f3a1 --option 1
Answered question 0192f3a1: EUR

Review proposed decisions. zt asks before it changes anything, and --yes skips the question. With no terminal, pass --yes.

Terminal window
zt decisions --status proposed # decisions waiting for review
zt decisions --q "invoice currency" # most similar first
zt decisions show 0192f3b7
zt decisions approve 0192f3b7 --comment "ok with the backfill plan"
zt decisions reject 0192f3b7 --comment "keep the old column until the backfill ends"

An ID is a full ID or its end, as the list prints it. zt stats --days 30 prints the answers reused, the median and 90th percentile time to answer, and counts of questions and decisions by status. The CLI reference lists every flag, and the HTTP API reference lists every route, such as POST /v1/questions/{question_id}/answer and POST /v1/decisions/{decision_id}/review.

Limit Value
Open questions per session 10, then 409 too_many_open_questions
Answer text 2 KiB
Proposed decisions per session 10, then 409 too_many_pending_decisions
Review comment 1024 bytes
Questions in one list 50 by default, at most 200
Decisions in one list or search 10 by default, at most 50 (20 over MCP)
  • The keyword list helps a careless agent, not a hostile one. An agent can describe a risky change in words the list does not hold, and nothing compares a decision with the diff.
  • If the only lead or admin in an org runs the agent, nobody can approve its high-risk decisions.
  • An answer one session gets is readable by every session in the project, and later questions can reuse it. Do not put secrets in answers.
  • The question_asked notice carries the agent’s own words, so a prompt-injected agent can put text in front of a person.
  • With the hash embedder, reuse catches near-identical wording only. Paraphrases need a semantic embedder.
  • Escalation tells the leads, but it does not reassign the question or answer it.
  • The Slack bot has not run against a real Slack workspace yet.