Skip to content

Build CompText Universe inside Hugging Face Space - #21

Merged
ProfRandom92 merged 10 commits into
mainfrom
plugin/hf-comptext-universe
Jul 16, 2026
Merged

ProfRandom92 merged 10 commits into
mainfrom
plugin/hf-comptext-universe

Conversation

@ProfRandom92

Copy link
Copy Markdown
Owner

Implements the approved CompText Universe + Compression Lab design while modifying only hf_space/**.

Includes:

  • static Universe snapshot with provenance and maturity states
  • architecture, capability, and skill explorers
  • deterministic non-executable AIR previews
  • simulated non-persistent Evidence previews
  • existing fail-closed hybrid compression and benchmarks
  • explicit no-provider/no-repository-write boundaries
  • isolated HF tests and design/implementation docs

Boundary verification: every changed path begins with hf_space/.

The Space remains an experimental public demonstration; the CompText runtime, CLI, schemas, workflows, providers, and TUI are untouched.

@ProfRandom92
ProfRandom92 merged commit e993c40 into main Jul 16, 2026
0 of 6 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transforms the existing Hugging Face Space into 'CompText Universe,' a public showcase for the CompText local orchestration architecture. It introduces a modular UI with new tabs for architecture, capabilities, and contract previews, while implementing static data loading, secret scanning, and comprehensive testing. The reviewer suggested improving consistency in the UI return types for secret detection and refactoring string literals into constants in the preview module for better maintainability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread hf_space/app.py
Comment on lines +37 to +42
payload = {
"decision": "blocked",
"reason": "Potential secret material detected. Input was not processed.",
"secret_matches": secret_matches,
}
return text, payload, pd.DataFrame(), json.dumps(payload, ensure_ascii=False, indent=2), None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The object returned for the compression_metrics UI component is inconsistent. In this 'secret detected' case, you return a payload dictionary with lowercase keys. In the successful compression case, you return a metrics dictionary with capitalized keys and a different structure. This can be confusing for the UI and any programmatic consumers.

I suggest creating a metrics dictionary here that is consistent with the one in the success path, and use that for the UI component, while keeping the payload for the raw JSON output.

Suggested change
payload = {
"decision": "blocked",
"reason": "Potential secret material detected. Input was not processed.",
"secret_matches": secret_matches,
}
return text, payload, pd.DataFrame(), json.dumps(payload, ensure_ascii=False, indent=2), None
metrics = {
"Decision": "blocked",
"Reason": "Potential secret material detected. Input was not processed.",
"Secret matches": secret_matches,
}
payload = {
"decision": "blocked",
"reason": "Potential secret material detected. Input was not processed.",
"secret_matches": secret_matches,
}
return text, metrics, pd.DataFrame(), json.dumps(payload, ensure_ascii=False, indent=2), None

Comment thread hf_space/previews.py
Comment on lines +28 to +39
def _constraints(text: str) -> list[str]:
lower = text.lower()
constraints: list[str] = []
if any(term in lower for term in ("no provider", "keine provider", "keine live-provider", "without provider")):
constraints.append("no_provider_calls")
if "--dry-run" in text:
constraints.append("dry_run_only")
if any(term in lower for term in ("do not write", "nicht ändern", "nicht veraendern", "read only", "nur lesen")):
constraints.append("no_writes")
if any(term in lower for term in ("do not commit", "nicht commit", "no commit")):
constraints.append("no_commits")
return sorted(set(constraints))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved readability and maintainability, the tuples of string literals used for matching constraints should be extracted into module-level constants. This avoids 'magic values' within the function and makes them easier to manage and reuse.

For example:

_NO_PROVIDER_TERMS = ("no provider", "keine provider", "keine live-provider", "without provider")
_NO_WRITES_TERMS = ("do not write", "nicht ändern", "nicht veraendern", "read only", "nur lesen")
_NO_COMMITS_TERMS = ("do not commit", "nicht commit", "no commit")

def _constraints(text: str) -> list[str]:
    lower = text.lower()
    constraints: list[str] = []
    if any(term in lower for term in _NO_PROVIDER_TERMS):
        constraints.append("no_provider_calls")
    if "--dry-run" in text:
        constraints.append("dry_run_only")
    if any(term in lower for term in _NO_WRITES_TERMS):
        constraints.append("no_writes")
    if any(term in lower for term in _NO_COMMITS_TERMS):
        constraints.append("no_commits")
    return sorted(set(constraints))

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant