Skip to content

Compress AI system prompt to core protocol contract#852

Open
GVCUTV wants to merge 1 commit intoissue665-iterative-correctionfrom
codex/refactor-system-prompt-template
Open

Compress AI system prompt to core protocol contract#852
GVCUTV wants to merge 1 commit intoissue665-iterative-correctionfrom
codex/refactor-system-prompt-template

Conversation

@GVCUTV
Copy link
Copy Markdown
Contributor

@GVCUTV GVCUTV commented Feb 23, 2026

Motivation

  • Reduce token usage and remove duplicated/verbose normative prose and examples while preserving the strict AI output contract used by the system.
  • Ensure the system prompt contains only the required schema contract, hard/soft precedence, role enum constraints, and output JSON format so runtime parsers remain deterministic.

Description

  • Rewrote src/main/resources/ai/system_prompt_template.txt to a compact, bullet-based prompt preserving behavior and adding a short top-level "Non-negotiable rules" section.
  • Retained the single-output variants JSON contract and the required variant labels EMPATHETIC, EFFICIENT, BALANCED, plus the schema for status, metadata, assignments, uncovered_shifts, and uffa_delta.
  • Kept and emphasized hard-vs-soft constraint precedence and role constraints (only STRUCTURED, SPECIALIST_JUNIOR, SPECIALIST_SENIOR) and explicit prohibition of echoing internal artifacts like role_validation_scratchpad.
  • Only changed src/main/resources/ai/system_prompt_template.txt and committed the change as "Compress AI system prompt to core protocol contract".

Testing

  • Reviewed relevant parser/validator classes under org.cswteams.ms3.ai.protocol (including AiScheduleJsonParser, AiScheduleVariantsResponseDto, AiScheduleResponseDto, AiScheduleSemanticValidator, AiRoleCoveredDeserializer, and AiUffaQueue) to confirm the compressed prompt aligns with existing expectations, and those inspections passed.
  • Attempted to run protocol tests with mvn -q -Dtest='org.cswteams.ms3.ai.protocol.*Test' test, but the build could not complete due to external Maven parent POM resolution failing with 403 Forbidden in this environment, so automated test execution did not finish.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant