Back to home

youxi-huang

dsh-gpt-file-discipline

A configurable DeepSeek Harness plugin that adds file-reading discipline to selected GPT model prompts.

Stars
1
Language
JavaScript
Created
Aug 14, 2026
Updated
Aug 14, 2026

Introduction

dsh-gpt-file-discipline

dsh-gpt-file-discipline is a small DeepSeek Harness Host plugin that adds a file-discipline section to the assembled system prompt for selected model steps. It waits for downstream waterfall listeners before matching, so it uses the provider and model chosen for the exact step rather than an earlier route candidate.

Install for a DSH profile

After this repository is published, add it to a DSH profile with the GitHub package spec:

dsh plugin --profile <profile> add github:youxi-huang/dsh-gpt-file-discipline

The package declares cordis.patch.yml as its bundle patch. Its official patch-entry array mounts one plugin row:

- insert:
    - id: gpt-file-discipline
      name: dsh-gpt-file-discipline

Cordis validates the exported Schemastery Config, applies its defaults, and owns listener registration and cleanup.

Defaults

The plugin matches provider codex exactly and model IDs beginning with gpt-, with case-insensitive model-prefix matching. A matching assembly receives one section named model-file-discipline with this text:

Local documents span many loosely related systems and include dormant or retired material, so do not browse files speculatively: locate the relevant source first, read only the smallest necessary passages, and stay strictly within the user-defined scope.

If a section with the configured name already exists, the plugin leaves the assembly unchanged.

Configuration

Cordis configuration patches are top-level patch-entry arrays. A configured insert has this shape:

- insert:
    - id: gpt-file-discipline
      name: dsh-gpt-file-discipline
      config:
        provider: custom-provider
        modelPrefix: Model-
        promptText: Read only the designated project sources.
        sectionName: custom-file-discipline
        caseSensitive: true

provider, modelPrefix, and promptText must be nonblank strings. sectionName must be 1–128 characters, start with a letter or digit, and contain only letters, digits, ., _, :, or -. caseSensitive must be a boolean and controls model-prefix matching only.

Profile installation applies the bundle to the DSH host, so the inserted plugin is host-wide. For preset-only use, make the package resolvable to DSH without adding its bundle layer, then add an ordinary plugin row to that preset's top-level entry list:

- id: gpt-file-discipline
  name: dsh-gpt-file-discipline
  config:
    provider: codex
    modelPrefix: gpt-

One practical route is to install the package as a dependency and then remove dsh-gpt-file-discipline from that profile's dsh.profile.bundles list before mounting the row in the preset. Do not use a map keyed by package name: agent preset compositions are top-level arrays of plugin rows.

Uninstall

Remove it from the same DSH profile using the installed package name:

dsh plugin --profile <profile> remove dsh-gpt-file-discipline

This removes the bundle-managed Cordis row; unloading the plugin disposes its listener registration.

Development

The committed index.js is the package entry point; no build or prepare step is required.

npm run check:syntax
npm test

License

MIT © 2026 youxi-huang