AutoBE
    Preparing search index...

    Interface AutoBeAnalyzeScenarioEvent

    Event interface for analyze scenario composition operations in the AutoBE system.

    This interface represents an event that orchestrates the creation of multiple analysis documents as part of a comprehensive requirements analysis phase. It enables the Analyze Agent to generate a series of interconnected planning documents that collectively form a complete specification for backend development.

    The scenario event follows the waterfall model approach, where each document builds upon previous ones to create a logical flow of information from high-level service overview to detailed technical specifications. This systematic approach ensures that all aspects of the backend system are thoroughly documented before any code generation begins.

    Key characteristics:

    • Supports multi-document analysis scenarios (minimum 1 document required)
    • Maintains context between documents through the step tracking
    • Defines user actors that will be used for authentication/authorization
    • Uses prefix for consistent naming and organization of generated documents

    Typical usage flow:

    1. Initial event creates overview and requirements documents (step 1-3)
    2. Subsequent events add user flows and technical specs (step 4-6)
    3. Final events complete with API specifications and data models (step 7+)

    Kakasoo

    interface AutoBeAnalyzeScenarioEvent {
        actors: AutoBeAnalyzeActor[];
        created_at: string & Format<"date-time">;
        files: Scenario[] & MinItems<1>;
        id: string;
        language?: string;
        metric: AutoBeFunctionCallingMetric;
        prefix: string;
        step: number;
        tokenUsage: IComponent;
        type: "analyzeScenario";
    }

    Hierarchy (View Summary)

    Index

    Properties

    Array of user actors that will interact with the backend system.

    These actors define the different types of authenticated users who will access the system, each with their own permissions and capabilities. The actors specified here directly influence:

    • Database schema generation (user models and actor relationships)
    • API endpoint authorization decorators
    • Test scenario generation for different permission levels
    • Business logic for actor-based access control

    Common patterns:

    • Public systems: ["customer", "admin"]
    • Marketplace: ["buyer", "seller", "admin", "support"]
    • Enterprise: ["employee", "manager", "hr", "admin", "auditor"]
    • Educational: ["student", "teacher", "parent", "admin"]

    Each actor should have a clear, distinct purpose and non-overlapping responsibilities to ensure clean authorization logic in the generated code.

    created_at: string & Format<"date-time">

    Timestamp when the event was created.

    ISO 8601 formatted date-time string indicating when this event was emitted by the system. This timestamp is crucial for event ordering, performance analysis, and debugging the agent workflow execution timeline.

    Format: "YYYY-MM-DDTHH:mm:ss.sssZ" (e.g., "2024-01-15T14:30:45.123Z")

    files: Scenario[] & MinItems<1>

    Array of document specifications to be generated in this scenario.

    This array defines the planning documents that the Analyze Agent will create during this event. Each document serves a specific purpose in the requirements analysis phase and contributes to the overall system specification.

    Requirements:

    • Minimum of 1 document per event (enforced by tags.MinItems<1>)
    • Documents should follow a logical progression
    • Each document should build upon information from previous ones
    • Later documents can reference earlier ones via relatedDocuments field

    Typical document progression:

    1. Service Overview - High-level vision and goals
    2. Requirements - Functional and non-functional requirements
    3. User Stories - Detailed user personas and scenarios
    4. User Flows - Step-by-step interaction sequences
    5. Business Model - Revenue, costs, and value propositions
    6. API Specification - Detailed endpoint documentation
    7. Data Models - Database schema and relationships

    The array structure allows flexible composition of documents based on project complexity and specific needs.

    id: string

    A unique identifier for the event.

    language?: string

    Language for document content. When specified by the user, this takes precedence over the locale setting for determining document language.

    Function calling trial statistics for the operation.

    Records the complete trial history of function calling attempts, tracking total executions, successful completions, consent requests, validation failures, and invalid JSON responses. These metrics reveal the reliability and quality of AI agent autonomous operation with tool usage.

    Trial statistics are critical for identifying operations where agents struggle with tool interfaces, generate invalid outputs, or require multiple correction attempts through self-healing spiral loops. High failure rates indicate opportunities for system prompt optimization or tool interface improvements.

    prefix: string

    Prefix identifier for the analysis scenario.

    This prefix serves as a namespace for all documents generated within this scenario, ensuring consistent organization and preventing naming conflicts. It typically represents the project or service name and is used to:

    • Group related analysis documents together
    • Create a consistent naming convention for generated files
    • Identify the context for subsequent agent operations
    • Enable parallel analysis of multiple services without conflicts

    Examples: "e-commerce", "social-media", "banking-system", "logistics-platform"

    The prefix should be:

    • Lowercase with hyphens for multi-word names
    • Descriptive enough to identify the service uniquely
    • Consistent across all related events in the scenario
    step: number

    Current step number in the multi-event analysis scenario.

    This field tracks the progression through a series of related analyze events, allowing the system to maintain context and ensure proper document sequencing. The step number is crucial for:

    • Maintaining document creation order
    • Referencing previous documents in the scenario
    • Determining when the analysis phase is complete
    • Coordinating with other agents that depend on analysis results

    Step progression patterns:

    • Step 1-3: Foundation documents (overview, requirements, user stories)
    • Step 4-6: Detailed specifications (user flows, business model, architecture)
    • Step 7+: Technical documents (API specs, data models, integration guides)

    The step number should increment with each new event in the same scenario, and agents use this to understand the current phase of analysis.

    tokenUsage: IComponent

    Detailed token usage metrics for the operation.

    Contains comprehensive token consumption data including total usage, input token breakdown with cache hit rates, and output token categorization by generation type (reasoning, predictions). This component-level tracking enables precise cost analysis and identification of operations that benefit most from prompt caching or require optimization.

    Token usage directly translates to operational costs, making this metric essential for understanding the financial implications of different operation types and guiding resource allocation decisions.

    type: "analyzeScenario"

    Unique identifier for the event type.

    A literal string that discriminates between different event types in the AutoBE system. This field enables TypeScript's discriminated union feature, allowing type-safe event handling through switch statements or conditional checks.

    Examples: "analyzeWrite", "databaseSchema", "interfaceOperation", "testScenario"