Skip to content

Commit 3029839

Browse files
committed
Move DEFAULT_DOCUMENT_AGENT_INSTRUCTIONS to constants
Mirrors the existing DEFAULT_MODERATOR_INSTRUCTIONS export so both CorpusAction default-instruction strings live in one place per the project's no-magic-strings convention. Importer site updated to pull from constants instead of the local module-level binding.
1 parent 84e43be commit 3029839

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- `frontend/tests/CreateCorpusActionModal.ct.tsx` (+8 tests): analyzer-path validation, inline-agent validation (empty name / empty instructions), existing-agent-selection validation, successful inline-agent mutation, backend error toast, analyzer edit-mode pre-population, and legacy trigger-casing normalization fallback.
2525
- `frontend/tests/CorpusAgentManagement.ct.tsx` (+8 tests): query loading state, query error state, multi-tool badge overflow, inactive-status badge, update-mutation happy path, create-mutation backend-error toast, tool deselection, and edit-modal cancel.
2626
- `frontend/tests/CorpusDescriptionEditor.ct.tsx` (+7 tests): save failure (`ok: false`), save network-error path, reapply of snapshot-less version, twice-click collapse, Cancel Version Edit reset, fetch-md URL failure, and version-count pluralization.
27+
- **Follow-up review polish**: moved `DEFAULT_DOCUMENT_AGENT_INSTRUCTIONS` from `CreateCorpusActionModal.tsx` into `frontend/src/assets/configurations/constants.ts` so both default-instruction strings (moderator + document agent) live in the single constants module per the project's no-magic-strings rule.
2728
- **Return-type annotations across core models and import/export pipeline** (Issue #1334, follow-up to #1331): The mypy gate wired in by #1331 recorded a 7208-error baseline frozen across 357 files. This PR pays down the annotation deficit on the core domain models and the bulk import/export tasks without touching runtime behavior or adding validators. Coverage jumped from the pre-issue numbers to:
2829
- `opencontractserver/corpuses/` 61.5% → 88.4% (target ≥80%)
2930
- `opencontractserver/annotations/` 48.1% → 93.8% (target ≥80%)

frontend/src/assets/configurations/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,3 +538,9 @@ export const DEFAULT_MODERATOR_INSTRUCTIONS = `You are a thread moderator for th
538538
3. Respond helpfully to user questions when appropriate
539539
540540
You have access to thread context, messages, and moderation tools. Use them judiciously.`;
541+
542+
// Default agent task instructions used when creating a document-processing
543+
// CorpusAction (rendered as the initial value when an add/edit document
544+
// trigger is selected).
545+
export const DEFAULT_DOCUMENT_AGENT_INSTRUCTIONS =
546+
"You are a document processing agent for this corpus.";

frontend/src/components/corpuses/CreateCorpusActionModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import { StyledTextArea } from "../widgets/modals/styled";
2020
import { toast } from "react-toastify";
2121
import _ from "lodash";
2222
import { OS_LEGAL_COLORS } from "../../assets/configurations/osLegalStyles";
23-
import { DEFAULT_MODERATOR_INSTRUCTIONS } from "../../assets/configurations/constants";
23+
import {
24+
DEFAULT_DOCUMENT_AGENT_INSTRUCTIONS,
25+
DEFAULT_MODERATOR_INSTRUCTIONS,
26+
} from "../../assets/configurations/constants";
2427
import { InlineBadge } from "../agents/AgentBadges";
2528
import { FormField } from "../widgets/form/FormField";
2629

@@ -72,9 +75,6 @@ const DEFAULT_MODERATION_TOOLS = [
7275
{ name: "unpin_thread", description: "Unpin a pinned thread" },
7376
] as const;
7477

75-
const DEFAULT_DOCUMENT_AGENT_INSTRUCTIONS =
76-
"You are a document processing agent for this corpus.";
77-
7878
/**
7979
* Shape of an existing corpus action for editing
8080
*/

0 commit comments

Comments
 (0)