Skip to content

Constraint 0020

Title

AI agent rules and standards

Description

This set of constraints defines the rules and standards for AI agent usage in the project.

  • [CS-0020.1] AI agent shall always link produced code to a requirement, a feature request, a task or a bug fix reference.
  • [CS-0020.1.1] Each class, methods, field, control structure, consistent block of statements shall be associated to a requirement, a feature request, a task or a bug fix.
  • [CS-0020.1.2] Association of code to a requirement, a feature request, a task or a bug fix shall be done using a comment block or a comment line with the reference of associated requirement, feature request, task or bug fix.
  • [CS-0020.2] AI agent shall always explain generated code using natural language, with references to the requirements, feature requests, tasks or bug fixes it is associated to.
  • [CS-0020.3] AI agent shall always self-evaluate produced code against the requirements, feature requests, tasks or bug fixes it is associated to, and shall document the evaluation result.
  • [CS-0020.4] AI agent shall always explain code modifications and code deletion.
  • [CS-0020.5] AI agent shall always self-evaluate code modifications and code deletion against the requirements, feature requests, tasks or bug fixes it is associated to, and shall document the evaluation result.
  • [CS-0020.5.1] AI Agent shall conduct impact analysis when modifying code.
  • [CS-0020.6] AI agent request human validation for:
    • [CS-0020.6.1] Deletion of architectural significant code.
    • [CS-0020.6.2] Modification of architectural significant code.
    • [CS-0020.6.3] Creation of architectural significant code.
    • [CS-0020.6.4] Modification of requirement, feature request, task or bug fix reference.
    • [CS-0020.6.5] Modification of constraint reference.
    • [CS-0020.6.6] Any modification that could impact security, performance, reliability or maintainability.
    • [CS-0020.6.7] Commit of code in version control system. Push to remote repository.
  • [CS-0020.7] Generated code shall be covered by unit tests and integration tests.
  • [CS-0020.7.1] Each code shall be tested thru, at least, one unit test.
  • [CS-0020.7.2] Each code shall be tested thru, at least, one integration test.
  • [CS-0020.7.3] Multithreaded code shall be stress-tested.
  • [CS-0020.7.4] Methods shall be tested against bag or wrong arguments and parameters including null values.
  • [CS-0020.8] When working on new features, the AI agent shall follow the following high level workflow upon its own mechanics:
  • [CS-0020.8.1] Analyze instructions, ensure it is goal driven. If not, ask for clarification and make proposals.
  • [CS-0020.8.2] Analyse instructions, assess if tests can be infered from instructions. If not, ask for clarification and make proposals.
  • [CS-0020.8.3] Remind all rules and constraints and ensure that instructions are consistent with them. If not, ask for clarification and make proposals.
  • [CS-0020.8.4] Analyze instructions, assess if code can be generated from instructions. If not, ask for clarification and make proposals.
  • [CS-0020.8.5] Analyze instructions against existing code, estimate impacts, if potential impacts may have side effects, ask for human validation and make proposals.
  • [CS-0020.8.6] Analyze instructions and evaluate if data models, class model, structures or interfaces can be created or updated. If not, ask for clarification and make proposals.
  • [CS-0020.8.7] Analyze instructions and evaluate if data models, class model, structures or interfaces need to be created or updated. If not, ask for clarification and make proposals.
  • [CS-0020.8.8] Plan and propose an implementation plan with:
    • [CS-0020.8.8.1] Tasks and sub-tasks. Each task or sub-task shall have an unique reference. Each task or sub-task shall be linked to a produced part and to a contribution to a referenced requirement, feature request, task or bug fix.
    • [CS-0020.8.8.2] Proposed plan shall cover produced code with tests.
    • [CS-0020.8.8.3] Proposed plan shall include documentation.
  • [CS-0020.8.9] When executing the plan, the AI agent shall,
    • [CS-0020.8.9.1] maintain and update the task list.
    • [CS-0020.8.9.2] maintain and update a task sequence with done / ongoing / upcoming tasks with dependencies.
    • [CS-0020.8.9.3] Report often about progress and tasks progression.
    • [CS-0020.8.9.4] Explain each choice.
    • [CS-0020.8.9.5] Update all documentation during the progression and use it as contributing knowledge.
    • [CS-0020.8.9.6] Evaluate if constraints and rules are satisfied.
    • [CS-0020.8.9.7] Evaluate if the plan need update. Study multiple solutions, evaluate pros and cons, ask for human validation and make proposals.
  • [CS-0020.10] When working on bug fixes, the AI agent shall follow the following high level workflow upon its own mechanics:
  • [CS-0020.10.1] Analyze instructions, ensure it is goal driven. If not, ask for clarification and make proposals.
  • [CS-0020.10.2] Analyze problem, make hypotheses and test them.
    • [CS-0020.10.2.1] Make hypothesis about causes. Validate each hypothesis by:
    • [CS-0020.10.2.1.1] tests (even expandable tests with scripts or temporary code),
    • [CS-0020.10.2.1.2] logic deduction,
    • [CS-0020.10.2.1.3] multiple internet searches,
    • [CS-0020.10.2.1.4] logs analysis,
    • [CS-0020.10.2.1.5] debugging,
    • [CS-0020.10.2.1.6] usage of third-party tools,
    • [CS-0020.10.2.1.7] usage of system tools,
    • [CS-0020.10.2.1.8] analysis of code history or git history.
    • [CS-0020.10.2.2] Maintain and update a list of hypotheses and causes. Link and chain them.
    • [CS-0020.10.2.3] Maintain a list of required or done modifications. Evaluate risks. Maintain a list of possible impacts.
  • [CS-0020.10.3] Remind all rules and constraints and ensure that instructions are consistent with them. If not, ask for clarification and make proposals.
  • [CS-0020.10.4] Analyze instructions, assess if code can be generated from instructions. If not, ask for clarification and make proposals.
  • [CS-0020.10.5] Analyze instructions against existing code, estimate impacts, if potential impacts may have side effects, ask for human validation and make proposals.
  • [CS-0020.10.6] Analyze instructions and evaluate if data models, class model, structures or interfaces can be created or updated. If not, ask for clarification and make proposals.
  • [CS-0020.10.7] Analyze instructions and evaluate if data models, class model, structures or interfaces need to be created or updated. If not, ask for clarification and make proposals.
  • [CS-0020.10.8] Plan and propose an implementation plan with:
    • [CS-0020.10.8.1] Tasks and sub-tasks. Each task or sub-task shall have an unique reference. Each task or sub-task shall be linked to a produced part and to a contribution to a referenced requirement, feature request, task or bug fix.
    • [CS-0020.10.8.2] Proposed plan shall cover produced code with tests.
    • [CS-0020.10.8.3] Proposed plan shall include documentation.
  • [CS-0020.10.9] When executing the plan, the AI agent shall,
    • [CS-0020.10.9.1] maintain and update the task list.
    • [CS-0020.10.9.2] maintain and update a task sequence with done / ongoing / upcoming tasks with dependencies.
    • [CS-0020.10.9.3] Report often about progress and tasks progression.
    • [CS-0020.10.9.4] Explain each choice.
    • [CS-0020.10.9.5] Update all documentation during the progression and use it as contributing knowledge.
    • [CS-0020.10.9.6] Evaluate if constraints and rules are satisfied.
    • [CS-0020.10.9.7] Evaluate if the plan need update. Study multiple solutions, evaluate pros and cons, ask for human validation and make proposals.
  • [CS-0020.11] Mandatory Multi-Method Verification:
  • [CS-0020.11.1] Work shall be verified at least twice using at least two different verification methods (e.g. Runtime ADB/Emulator process status check AND JUnit test suite run).
  • [CS-0020.11.2] Every task and work result shall produce a documented Proof of Work artifact before declaring completion.
  • [CS-0020.12] Periodic Progress Reporting:
  • [CS-0020.12.1] AI agents shall report progress and activities as often as possible and at least every 2 minutes during execution tasks.
  • [CS-0020.13] Strict Prohibition of Simulated / Fake Implementations:
  • [CS-0020.13.1] No Hardcoded Fakes or Mock Decoders: AI agents are strictly forbidden from substituting core algorithmic, mathematical, or signal processing logic with hardcoded template arrays, pre-baked response lists, or fake mock outputs in production code.
  • [CS-0020.13.2] Empirical Verification of Real Native Inference: Any native C++/JNI, machine learning model, or hardware decoding feature MUST perform real mathematical computation or native library calls on actual input data.
  • [CS-0020.13.3] Transparent Failure Reporting: If a dependency (such as a large model binary or C++ native library) is missing, the AI agent MUST explicitly report the missing prerequisite to the user and request instructions, rather than silently implementing a fake substitute.

Rationale

Verification