Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,11 @@ Stage labels and the floor scene follow returned plans and jobs. Failed or pause

`Collaboration.feedback` captures the current native run and prepares its deterministic card. `CommunicationWriter` resolves only the explicit `communication` task, validates the frozen model profile, and invokes the bounded drafting/classification flow. Bridge uses prompted structured JSON through the existing OpenAI-compatible adapter; API profiles use the existing native model adapter. Central YAML/Jinja templates own the instructions and composition.

The draft references a bounded fact packet rather than repository prose or command output. Request template `collaboration/communication-request` version `1.0.1` supplies the exact allowed paragraph citation IDs from that packet. Citations name top-level groups such as `state`, rather than a JSON path such as `state.status`; unknown IDs remain invalid. The earlier template is retained for provenance. After validation, the service reads the run again. A changed milestone or fact-packet digest discards the draft and holds configured AI delivery without a substitute card. The retained intent contains the exact body, body hash, fact hash, prompt hash and profile revision before the existing remote-write boundary. Current actor, credentials and selected model routing are checked again there. Existing fingerprints and remote-outcome reconciliation continue to prevent automatic duplicate comments.
The draft references recorded run facts and selected check excerpts. The current human question reaches both writer and reviewer as a digest-bound quotation; it helps answer the request but grants no execution authority. Request template `collaboration/communication-request` version `1.0.3` supplies the exact allowed paragraph citation IDs from that packet. Citations name top-level groups such as `state`, rather than a JSON path such as `state.status`; unknown IDs remain invalid. The earlier template is retained for provenance. After validation, the service reads the run again. A changed milestone or fact-packet digest discards the draft and holds configured AI delivery without a substitute card. The retained intent contains the exact body, body hash, fact hash, prompt hash and profile revision before the existing remote-write boundary. Current actor, credentials and selected model routing are checked again there. Existing fingerprints and remote-outcome reconciliation continue to prevent automatic duplicate comments.

System template `collaboration/communication-system` version `1.0.3` asks the agent to write the complete card: a specific title, useful paragraphs and, when needed, the exact human question and choices. The existing skill injector includes the pinned Humanizer adaptation in the real instructions. Its revision and adaptation digest are retained; no upstream script or installation is executed. The fact packet includes internally consistent saved check totals, native acceptance/review-link state and an allowlisted source-safety blocker. That blocker comes from the recorded error; it is not an independent security diagnosis. Raw error messages, provider summaries and command output are withheld. The title and paragraphs cite exact fact groups, including the offered blocker and check context. A separate AI reviewer evaluates claims against those same facts; word matching does not decide whether a negation is a positive claim.
System template `collaboration/communication-system` version `1.0.6` asks the agent to write the complete card: a specific title, useful paragraphs and, when needed, the exact human question and choices. The existing skill injector includes the pinned Humanizer adaptation in the real instructions. Its revision and adaptation digest are retained; no upstream script or installation is executed. The fact packet includes internally consistent saved check totals, native acceptance/review-link state and an allowlisted source-safety blocker. That blocker comes from the recorded error; it is not an independent security diagnosis. Arbitrary raw errors and provider summaries remain withheld. Known guard refusals have display-only reason codes; they do not establish a root cause or permit recovery. Final-check commands and outputs can supply separately identified diagnostic excerpts after privacy filtering. The title and paragraphs cite exact fact groups, including the offered blocker and check context. A separate AI reviewer evaluates claims against those same facts; word matching does not decide whether a negation is a positive claim.

`CommunicationCard` is a strict structured output with a cited title, cited paragraphs and an optional decision quotation. Central `collaboration/communication-card` and `collaboration/communication-decision` templates apply Markdown formatting to that output. They do not append a generic status card. The original templates remain available for provenance. A human decision must retain the complete bounded public question, context and ordered choices; oversized quotations hold configured AI delivery. No generated answer can resume work or grant permissions. Drafting uses one tool-free request with a 1,400-token output ceiling. A separate tool-free `CommunicationReview` request has a 700-token ceiling. A rejected or uncertain classification triggers one final AI correction, after which forge responds without another semantic veto. SDK retries are disabled and all calls share one selected-profile deadline capped at 120 seconds, including bridge queue time. The underlying run, WAL and native receipt remain authoritative.
`CommunicationCard` is a strict structured output with a cited title, cited paragraphs, optional section headings or bullet items, and an optional decision quotation. The AI chooses the useful structure for the current question. An optional `diagnostic_id` selects an existing final-check command or output excerpt; the model cannot supply replacement code or log bytes. `communication_diagnostics.py` preserves line breaks, marks current/retained/unknown provenance, withholds sensitive-looking assignments or private-key material, removes local paths and destinations, and retains the truncation flag. Known-credential rejection and the existing current-facts check still apply. Adaptive code fences prevent a log fragment from escaping into mentions or links. Central `collaboration/communication-card` and `collaboration/communication-decision` templates apply Markdown formatting to that output. They do not append a generic status card. The original templates remain available for provenance. A human decision must retain the complete bounded public question, context and ordered choices; oversized quotations hold configured AI delivery. No generated answer can resume work or grant permissions. Drafting uses one tool-free request with a 1,400-token output ceiling. A separate tool-free `CommunicationReview` request has a 700-token ceiling. A rejected or uncertain classification triggers one final AI correction, after which forge responds without another semantic veto. SDK retries are disabled and all calls share one selected-profile deadline capped at 120 seconds, including bridge queue time. The underlying run, WAL and native receipt remain authoritative.

After any generation outcome, the service checks the current milestone and fact digest again. If either changed during configured AI wording, it holds delivery without posting stale prose or substituting a generic card. Delivery testing includes direct review of the actual published wording: an AI-mode receipt alone does not establish that the update is useful.

Expand All @@ -760,7 +760,7 @@ Generation is optional presentation work with one total deadline and bounded per

### Semantic review of source-control messages

The writer and reviewer are separate `FireflyAgent` invocations using the same selected communication profile. The reviewer sees only the exact structured candidate and bounded recorded facts. The candidate is quoted data, not instructions. Its strict result contains a verdict, issue categories, fact references and a short rationale. It checks the whole passage for supported negations, contradictions, misleading check results, unrecorded actions and human decisions. It neither rewrites the candidate nor uses tools.
The writer and reviewer are separate `FireflyAgent` invocations using the same selected communication profile. The reviewer sees only the exact structured candidate and bounded recorded facts. The candidate is quoted data, not instructions. Its strict result contains a verdict, issue categories, fact references and a short rationale. Review template `collaboration/communication-review-system` version `1.0.3` checks the whole passage for supported claims, check provenance, pending human decisions and exact diagnostic choices. It can also request a correction for `unclear_language` or `poor_structure`: factual wording still needs to answer the person clearly. It evaluates meaning instead of enforcing a fixed set of headings or a banned-word list. It neither rewrites the candidate nor uses tools.

<div class="forge-flow" role="region" aria-label="Semantic review of source-control messages" aria-describedby="semantic-review-flow-guide" tabindex="0" markdown="1">

Expand Down
4 changes: 2 additions & 2 deletions docs/model-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ The model writes the complete update: a specific title, an explanation, the avai

Each eligible update uses a tool-free drafting request and an independent semantic classification against the same facts. If the classifier finds unsupported claims or uncertainty, one additional AI request corrects the message and returns the final response. There is no second semantic veto or correction loop. All requests use the selected profile with SDK retries disabled. The draft allows 1,400 output tokens; the review allows 700. One total deadline, capped at 120 seconds, covers queue time and all requests. It does not restart for the review. The effective timeout is retained in the communication receipt. Use a 60-second profile timeout for local subscription workers; a shorter configured limit remains in force.

The fact packet contains the recorded state, active stage, recovery attempt, check totals and provenance, known source-safety blockers and native delivery state. A pending human decision also supplies a bounded, safely escaped quotation of the question, context and choices. The generated decision must preserve that quotation and every choice; it cannot supply an answer. Questions that cannot fit the public quotation bounds hold AI delivery rather than silently shortening the options. Customer briefs, raw errors, source, logs and credentials are withheld.
The fact packet contains the recorded state, active stage, recovery attempt, check totals and provenance, known source-safety blockers and native delivery state. A pending human decision also supplies a bounded, safely escaped quotation of the question, context and choices. The generated decision must preserve that quotation and every choice; it cannot supply an answer. Questions that cannot fit the public quotation bounds hold AI delivery rather than silently shortening the options. The current human question reaches both writer and reviewer as quoted context, separate from execution authority. Arbitrary raw errors, provider summaries, source files and credentials stay private. Recorded final-check commands and outputs can supply selected diagnostic excerpts: local paths and destinations are removed, sensitive-looking assignments or private keys withhold the excerpt, and known-credential checks still apply. The model references an existing excerpt instead of generating code or a traceback.

Native checks validate the message structure, citation identities, public quotation and current authority. A separate structured AI review classifies the complete candidate as supported, unsupported or uncertain. It checks meaning in context, including negations, numbers, saved versus current results, delivery claims and pending human decisions. It does not classify prose with keyword lists. A supported classification proceeds directly; otherwise the AI makes its single correction and responds, explaining missing information or asking a specific question when needed. The original review is explicitly bound to the original candidate; it is not relabeled as an independent approval of the correction. The receipt retains the candidate digest, review prompt digest, verdict, issues and rationale. This is a fallible model review, not independent product QA or proof of every sentence. With an AI profile selected, forge never substitutes a generic template. A provider outage, exhausted quota, malformed result or failed native authority/framing check holds delivery with its recorded reason, without a remote comment or automatic repeated model calls. A new explicit request can try again. Choosing recorded updates without an AI profile remains a separate configuration mode. There is no automatic provider substitution.
Native checks validate the message structure, citation identities, public quotation and current authority. A separate structured AI review classifies the complete candidate as supported, unsupported or uncertain. It checks meaning in context, including numbers, saved versus current results, delivery claims, exact excerpts and pending human decisions. It also reviews whether the wording and structure explain the answer clearly. It does not classify prose with keyword lists. A supported classification proceeds directly; otherwise the AI makes its single correction and responds, explaining missing information or asking a specific question when needed. The original review is explicitly bound to the original candidate; it is not relabeled as an independent approval of the correction. The receipt retains the candidate digest, review prompt digest, verdict, issues and rationale. This is a fallible model review, not independent product QA or proof of every sentence. With an AI profile selected, forge never substitutes a generic template. A provider outage, exhausted quota, malformed result or failed native authority/framing check holds delivery with its recorded reason, without a remote comment or automatic repeated model calls. A new explicit request can try again. Choosing recorded updates without an AI profile remains a separate configuration mode. There is no automatic provider substitution.

The receipt retains `feedback_intent.communication`: its mode and any hold reason, fact packet and digest, selected profile revision, prompt digest and applied skill provenance. The exact final body and its SHA-256 are saved before the remote comment is attempted. If the run changes while drafting, configured AI delivery is held without a template replacement or another automatic model call. Unknown remote delivery remains held for reconciliation; a second comment is not sent automatically.

Expand Down
8 changes: 8 additions & 0 deletions docs/repository-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ GitHub and Bitbucket signatures are verified against raw bytes without JSON rese

A provider user ID is separate from the factory session identity. Granting a comment author permission does not turn that author into a factory administrator or let a command replace operator-owned checks. A factory administrator should complete the full Studio setup and receipt-inspection journey; the repository policy API also enforces the narrower project permissions above.

## Read the bot's updates

The bot answers the current question before recapping the product. An update explains what changed, the relevant checks, the present blocker and any decision needed from you. The selected communication model writes the title and explanation, chooses useful headings or bullets, and passes through the Humanizer instructions and a separate factual and editorial review.

When a recorded check helps explain a failure, the bot can include its command or an output excerpt in a code block. Those bytes come from the saved check, with privacy filtering; they are not code invented by the writer. Older results stay labeled as older results. If no diagnostic or cause is known, the bot must say what information is missing instead of guessing a faulty line. A status answer does not start another execution.

Use **Plan** and **Verification** for the full run evidence. A failed automation step can coexist with passing checks, and passing checks do not replace the remaining product journeys. Ask a specific follow-up in the same issue when you need the next level of detail.

## First conversation, then reviewed work

1. Finish repository connection, current account mapping and the scoped GitHub polling setup. The execution owner must be running; an API-only process does not process the conversation.
Expand Down
7 changes: 7 additions & 0 deletions src/firefly_forge/collaboration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1996,11 +1996,18 @@ def native_card(current_run: Data) -> str:
else None
)
if data.get("natural_turn") is not None:
current_question = data["natural_turn"].get("human_message")
conversation_input = CommunicationConversationV1(
selection="run" if run else "clarify",
language=(data["natural_turn"].get("decision") or {}).get("language")
or data["command"].get("language", "en"),
linked_runs=1 if run else 0,
question=current_question
if isinstance(current_question, str) and current_question.strip()
else None,
question_sha256=hashlib.sha256(current_question.encode()).hexdigest()
if isinstance(current_question, str) and current_question.strip()
else None,
)
assistant_input = assistant_communication(data, repository=repo, host=host)
drafted: Data
Expand Down
Loading
Loading