Commit Graph

14 Commits

Author SHA1 Message Date
Dhanji R. Prasanna
5caa101b84 Fix inline JSON being incorrectly detected as tool call
The bug was caused by mark_tool_calls_consumed() being called after
displaying each chunk, which advanced last_consumed_position to the
end of the current buffer. When the next chunk arrived with JSON,
the unchecked_buffer started at position 0 of the slice, causing
is_on_own_line() to return true (position 0 is always "on its own line").

Removed the problematic mark_tool_calls_consumed() call from the
"no tool executed" branch. The remaining call after actual tool
execution is correct and necessary.

Added integration test that verifies inline JSON in prose is not
detected as a tool call.
2026-01-19 14:35:01 +05:30
Dhanji R. Prasanna
85ea8fe69c Update project memory with agent-specific language prompts
Document the new agent+language prompt injection feature including:
- AGENT_LANGUAGE_PROMPTS static array location
- get_agent_language_prompt() and get_agent_language_prompts_for_workspace_with_langs()
- File naming pattern: prompts/langs/<agent>.<lang>.md
- Instructions for adding new agent+lang prompts
2026-01-15 06:43:42 +05:30
Dhanji R. Prasanna
afec65fd50 Add language-specific prompt injection for toolchain guidance
- Add language_prompts module that auto-detects programming languages in workspace
- Scan for language files with depth limit (2) to inject relevant toolchain prompts
- Add prompts/langs/ directory for language-specific markdown files
- Include Racket/raco toolchain guidance as first language prompt
- Update combine_project_content() to accept language_content parameter
- Integrate language detection into main CLI flow and agent mode
- Update project memory with new feature documentation
2026-01-14 21:00:52 +05:30
Dhanji R. Prasanna
a1dfd9c0b6 Enhanced auto-memory with rich few-shot format
- Updated memory reminder prompt with per-symbol char ranges
- Added two few-shot examples: Session Continuation (feature) + UTF-8 Safe Slicing (pattern)
- Updated system prompt Memory Format section to match
- Format: file -> nested symbols with [start..end] ranges and descriptions
- Enables direct read_file navigation to specific functions
2026-01-13 21:49:48 +05:30
Dhanji R. Prasanna
9a3b03a41f Remove flock mode (superseded by studio)
Flock mode has been superseded by the studio multi-agent workspace manager.

Changes:
- Remove g3-ensembles crate entirely
- Remove --project, --flock-workspace, --segments, --flock-max-turns CLI flags
- Remove run_flock_mode() from autonomous.rs
- Remove flock-related tests from cli_integration_test.rs
- Update README.md, docs/architecture.md, analysis/memory.md
- Delete docs/FLOCK_MODE.md
2026-01-13 15:01:12 +05:30
Dhanji R. Prasanna
81ea149369 Fix confusing documentation references
1. architecture.md: Fixed diagram to show 'studio' instead of 'g3-console'
   (the crate was renamed during development)

2. analysis/memory.md: Removed reference to non-existent machine_ui_writer.rs

3. theme.rs: Clarified that 'retro' is a theme option (the default theme),
   not a separate TUI mode. No --retro CLI flag exists.
2026-01-12 20:49:37 +05:30
Dhanji R. Prasanna
028285825b Update dependency analysis artifacts
Refreshed static analysis of workspace dependency structure:
- graph.json: 10 crates, 17 crate-level edges, 95 files, 123 file-level edges
- graph.summary.md: Updated metrics and fan-in/fan-out rankings
- sccs.md: Confirmed no cycles (DAG structure intact)
- layers.observed.md: 5-layer hierarchy from binaries to infrastructure
- hotspots.md: Identified g3-config, g3-providers as high fan-in; g3-cli as high fan-out
- limitations.md: Documented extraction method constraints

Agent: euler
2026-01-12 20:32:16 +05:30
Dhanji R. Prasanna
43a5d27149 Add compact format for remember, take_screenshot, code_coverage, rehydrate
Extend compact single-line output to additional tools:
- remember: shows '📝 memory updated (size)'
- take_screenshot: shows '📸 path'
- code_coverage: shows '📊 report generated'
- rehydrate: shows '🔄 restored fragment_id'

Tools without file_path argument use simplified format:
  ● tool_name | summary | tokens ◉ time
2026-01-12 14:45:50 +05:30
Dhanji R. Prasanna
33558bc092 Update project memory with new location documentation 2026-01-12 11:25:59 +05:30
Dhanji R. Prasanna
d508ddd508 Move project memory from .g3/ to analysis/ for version control
Project memory is now stored at analysis/memory.md instead of .g3/memory.md.
This change enables:
- Shared memory across git worktrees (studio agent sessions)
- Version-controlled memory that persists across clones
- Memory changes tracked in git history and reviewable in PRs

Changes:
- crates/g3-core/src/tools/memory.rs: Update get_memory_path() to use analysis/
- crates/g3-cli/src/project_files.rs: Update read_project_memory() path
- crates/g3-core/src/prompts.rs: Update documentation references (2 occurrences)
- analysis/memory.md: Add memory file (copied from .g3/memory.md)
2026-01-12 10:20:33 +05:30
Dhanji R. Prasanna
4fb605fe7e Update dependency analysis artifacts
Refreshed static dependency analysis for the G3 codebase:

- graph.json: 143 nodes (9 crates, 134 files), 189 edges
- No cycles detected (DAG structure confirmed)
- Top fan-in: g3-core (43), g3-providers (27), g3-config (16)
- Top fan-out: g3-core/src/lib.rs (27), g3-cli/src/lib.rs (12)
- 4-layer architecture: Foundation → Core → Services → Application

Extraction method: Cargo.toml parsing + regex-based import analysis
Limitations documented: internal crate imports, re-exports, conditional compilation

Agent: euler
2026-01-11 16:11:01 +05:30
Dhanji R. Prasanna
f0bd7959b1 chore(analysis): update dependency analysis artifacts
Authored by: Structural Analysis Agent (Euler)

Updated all dependency analysis artifacts with fresh extraction:
- graph.json: Canonical dependency graph with 10 crates, 139 files, 16 crate edges, 72 file edges
- graph.summary.md: Overview with fan-in/fan-out rankings and crate inventory
- sccs.md: SCC analysis confirming no cycles at crate or file level (clean DAG)
- layers.observed.md: 5-layer architecture diagram derived from dependencies
- hotspots.md: Coupling hotspots (g3-config highest fan-in, g3-cli highest fan-out)
- limitations.md: Documented extraction limitations (conditional compilation, macros, etc.)

Key findings:
- All 10 workspace crates form a directed acyclic graph
- g3-core/src/ui_writer.rs has highest file-level fan-in (10 dependents)
- g3-console is standalone with no workspace dependencies
- Clean layered architecture with no violations detected
2026-01-07 09:36:52 +11:00
Dhanji R. Prasanna
2d8e733820 Add dependency graph JSON data
Add exception to .gitignore for analysis/deps/graph.json
2026-01-06 13:24:01 +11:00
Dhanji R. Prasanna
6d6aed563d Add structural dependency analysis artifacts
- graph.json: Canonical dependency graph (10 crates, 16 edges, 76 files)
- graph.summary.md: One-page overview with fan-in/fan-out rankings
- sccs.md: Strongly Connected Components analysis (no cycles)
- layers.observed.md: 5-layer architecture diagram
- hotspots.md: Coupling hotspots (g3-config, g3-cli)
- limitations.md: Extraction limitations and validity conditions
2026-01-06 13:23:24 +11:00