Experiment feat impl:Intent Coding MVP workflow (#854)#873
Open
harryfan1985 wants to merge 16 commits into
Open
Experiment feat impl:Intent Coding MVP workflow (#854)#873harryfan1985 wants to merge 16 commits into
harryfan1985 wants to merge 16 commits into
Conversation
Main refactored RequestContextPolicy from static constructors to a builder pattern (::empty().with_*()). Update IntentCodingMode to use the new API instead of the removed ::full() method. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53a43fa to
8b98639
Compare
…se in README The 26 intent/evidence pairs were self-hosted development artifacts from the MVP implementation, not runtime dependencies. Only rules/, knowledge/, and changes/ are loaded into agent context. - Keep 1 representative pair as a format example - Add a table in README clarifying that intents/evidence are per-task delivery artifacts, not runtime context - agent:check still passes (1 Intent Record + 1 Evidence Package)
…les/ The three-directory split (rules/knowledge/changes) was a conceptual distinction with no functional difference — the context loader processes all three identically. At MVP stage, one context directory is sufficient. - Delete .agent/knowledge/ and .agent/changes/ - instruction_context.rs: AGENT_CONTEXT_DIRS reduced to .agent/rules - Update all context-loader tests to use rules/ only - intent_coding_mode.md prompt: simplify context-loading instructions - .agent/README.md: drop knowledge/changes from directory map and task lifecycle - provenance-chain.md, context-budget.md: remove knowledge/changes references - PR GCWing#873 body: add architecture reference table from former knowledge file
…runtime These are per-task delivery artifacts, not repository scaffolding. The agent creates .agent/intents/ and .agent/evidence/ on demand when writing Intent Records and Evidence Packages. - Delete .agent/intents/ and .agent/evidence/ - Delete stale templates: knowledge-template.md, change-template.md - agent:check: intents/evidence no longer required; validate only when the dirs have files, otherwise report 'No active' info - Update README, prompt to document runtime-on-demand behavior
Move IntentCoding workflow rules from workspace .agent/ into prompts/intent_coding_rules/, loaded via include_str!(). - 9 rule files embedded in intent_coding.rs build_prompt() - instruction_context.rs: .agent/rules removed from context dirs - intent_coding_mode.md: updated to reference built-in rules - agent:check: simplified to only validate Intent/Evidence when present - Delete .agent/ directory from repository Signed-off-by: harryfan1985 <harryfan1985@gmail.com>
- Add .agent/ to .gitignore to prevent accidental commit of runtime artifacts - Downgrade intent-without-evidence to WARN in agent:check so mid-task runs don't fail - Replace fragile rules.len()==9 assertion with per-name checks in test - Remove context-budget.md rule (implementation detail, not agent guidance) - Remove redundant || '' in modeDisplay.translatedOrEmpty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Linked Issue
Closes #854
Issue: #854
This PR is the experimental MVP implementation for the intent-aligned Coding Agent workflow discussed in #854. It is intentionally scoped as a first working loop rather than the full five-phase platform.
Summary
This PR implements the first BitFun-native MVP for intent-aligned Coding Agent work.
The core goal is to move Coding Agent delivery from:
to:
This is intentionally an MVP. It proves the value of an intent-first delivery loop with a dedicated mode, built-in workflow rules, runtime-created Intent/Evidence artifacts, prompt guidance, and structural validation.
Theoretical Basis and Design Thinking
This implementation is based on the direction from #854: Coding Agent reliability is now less limited by code generation ability and more limited by intent engineering. In practice, many agent failures happen because the model acts quickly inside ambiguous requirements, incomplete context, or missing domain constraints.
The design borrows from three related research/product ideas:
The MVP intentionally avoids a large platform build. Instead, it creates a hard local delivery constraint:
What Changed
Intent Coding Mode
IntentCodingmode.pnpm run agent:checkwhen available.Key files:
src/crates/core/src/agentic/agents/definitions/modes/intent_coding.rssrc/crates/core/src/agentic/agents/prompts/intent_coding_mode.mdsrc/crates/core/src/agentic/agents/registry/catalog.rssrc/crates/core/src/agentic/agents/registry/builtin.rsBuilt-In Intent Coding Rules
Workflow rules are now product code, not repository-local
.agentsource files. They live under:IntentCodingModeembeds these rules withinclude_str!()and appends them to the mode prompt as a dedicated context section.Rules cover:
Runtime Intent/Evidence Artifacts
Intent Records and Evidence Packages are runtime/on-demand artifacts:
They are no longer committed as repository scaffolding. The
.agentdirectory is treated as an active-task workspace artifact, not as the product prompt/template registry. For the MVP this is the chosen artifact location; durable provenance should later move into session-scoped structured storage such as.bitfun/sessionsor a dedicated session provenance store.Workflow Checker
Added:
The checker validates active
.agentartifacts when they exist:If no
.agentartifacts exist, the command exits successfully and reports that there is no active Intent Coding task.The command now runs in CI as a lightweight structural gate. This check is structural only. It does not replace product verification and does not judge acceptance quality.
Frontend Support
IntentCodingin Flow Chat persisted agent types.IntentCodingentry.IntentCoding.IntentCodingturn completes without an Evidence Package signal.Vitest Monaco Isolation
Full web tests exposed a pre-existing Node/Vitest environment problem around static
monaco-editorresolution. This PR adds a test-mode-only Monaco alias and lightweight mock so non-editor tests do not resolve real Monaco runtime modules.The alias is only active in test mode.
Verification
Previously run and passing on this branch:
cargo check --workspace cargo test --workspace pnpm --dir src/web-ui run test:run pnpm run lint:web pnpm run type-check:web pnpm run agent:checkAdditional local checks:
IntentCodingprompt/registry behavior,Current CI status should be treated as authoritative before merge.
Review Guide
Recommended review order:
src/crates/core/src/agentic/agents/prompts/intent_coding_mode.mdsrc/crates/core/src/agentic/agents/definitions/modes/intent_coding.rsinclude_str!()the right product location?src/crates/core/src/agentic/agents/prompts/intent_coding_rules/*scripts/check-agent-workflow.mjsFrontend mode and test changes
IntentCodingmode naming/description acceptable?Architecture Reference
src/crates/core/src/agentic/agents/definitions/modes/intent_coding.rssrc/crates/core/src/agentic/agents/prompts/intent_coding_mode.mdsrc/crates/core/src/agentic/agents/prompts/intent_coding_rules/src/crates/core/src/agentic/agents/registry/catalog.rssrc/web-ui/src/flow_chat/store/FlowChatStore.tssrc/web-ui/src/app/scenes/agents/utils.tsscripts/check-agent-workflow.mjsConstraints:
.agentis an active-task artifact location, not the product prompt/template source.MVP Boundaries
This PR does not implement:
These are deliberate P1/P2 follow-ups.
Follow-Up TODO
P2:
Notes For Reviewers
The current PR is now code/prompt-rule focused rather than
.agentartifact focused. The main product decision is whetherIntentCodingshould ship as an experimental separate mode with built-in workflow rules, while hard runtime artifact enforcement and governance remain future work.