feat: wiki incremental Mode A/B with durable rewrite barrier (#18122)

Port the wiki_incremental dataset-level merge and make its rewrite
barrier durable and concurrency-safe. Wiki pages merge replace-only; the
barrier persists a monotonic numeric generation, and a scheduler-backed
per-dataset lock closes the cross-process TOCTOU window. Adds the
Compiler Plan toggle (frontend) with Mode A grouping.
This commit is contained in:
Zhichang Yu
2026-08-11 22:10:49 +08:00
committed by GitHub
parent 646fd8c2a6
commit d9ed14ce9c
27 changed files with 1635 additions and 507 deletions

View File

@@ -1912,7 +1912,9 @@ Example: Virtual Hosted Style`,
instruction: 'Instruction',
globalRules: 'Global rules',
globalRulesPlaceholder: 'Input global compilation rules',
plan: 'Plan (grouping wiki pages by topic via LLM)',
plan: 'Plan',
planTip:
'Off: one wiki page per entity/concept. On: let the LLM decide to combine some entities/concepts into a single wiki page.',
raptorTreeSettings: 'RAPTOR tree settings',
summarizationPrompt: 'Summarization prompt',
maxToken: 'Max token',

View File

@@ -1599,7 +1599,8 @@ NER使用 spaCy NER 和基于规则的关键词提取来抽取实体和关系
instruction: 'Instruction',
globalRules: '全局规则',
globalRulesPlaceholder: '请输入全局编译规则',
plan: 'Plan (LLM 分组合并 wiki 页面)',
plan: 'Plan',
planTip: '关闭:每个实体或概念对应一个 wiki 页面。开启:让 LLM 决定将某些实体/概念组合到单个 wiki 页面。',
raptorTreeSettings: 'RAPTOR 树设置',
summarizationPrompt: '摘要提示词',
maxToken: '最大 token 数',

View File

@@ -363,6 +363,7 @@ export const initialExtractorValues = {
export const initialCompilationValues = {
compilation_template_group_id: '',
llm_id: '',
plan: false,
outputs: {
chunks: { type: 'Array<Object>', value: [] },
},

View File

@@ -1,6 +1,8 @@
import { CompilationTemplateFormField } from '@/components/compilation-template-form-field';
import { LargeModelFormField } from '@/components/large-model-form-field';
import { SwitchFormField } from '@/components/switch-fom-field';
import { Form } from '@/components/ui/form';
import { useTranslate } from '@/hooks/common-hooks';
import { zodResolver } from '@hookform/resolvers/zod';
import { memo } from 'react';
import { useForm } from 'react-hook-form';
@@ -18,6 +20,7 @@ import { Output } from '../components/output';
export const FormSchema = z.object({
compilation_template_group_id: z.string().optional(),
llm_id: z.string().optional(),
plan: z.boolean(),
});
export type CompilationFormSchemaType = z.infer<typeof FormSchema>;
@@ -31,6 +34,7 @@ const CompilationForm = ({
}: INextOperatorForm) => {
const defaultValues = useFormValues(initialCompilationValues, node);
const ownerTenantId = useOwnerTenantId();
const { t } = useTranslate('setting');
const form = useForm<CompilationFormSchemaType>({
defaultValues,
@@ -49,6 +53,11 @@ const CompilationForm = ({
name="llm_id"
ownerTenantId={ownerTenantId}
></LargeModelFormField>
<SwitchFormField
name="plan"
label={t('plan')}
tooltip={t('planTip')}
></SwitchFormField>
</FormWrapper>
{!hideOutputs && (
<div className="p-5">